Store Operators like >= OR <= in Microsoft Access
up vote
0
down vote
favorite
I have certain values that are needed for validation in Forms, either they look like Value X >= 0
but it could also be X <= 0
, it depends on what operator should be used. How can I store such a value?
(I use MS SQL Server + Access as Frontend)
I basicly wanna store the Value and if it needs to be bigger than or smaller than.
sql-server ms-access
add a comment |
up vote
0
down vote
favorite
I have certain values that are needed for validation in Forms, either they look like Value X >= 0
but it could also be X <= 0
, it depends on what operator should be used. How can I store such a value?
(I use MS SQL Server + Access as Frontend)
I basicly wanna store the Value and if it needs to be bigger than or smaller than.
sql-server ms-access
How then you would use those values after you store them? What are you trying to do? just store them and that's it?
– Sami
yesterday
@Sami I wanna use them for conditional Formatting, ergo the field value needs to be<= 0
just as an example
– Badgy
yesterday
It seems to (if I understand) that you just need a booleanTRUE/FALSE
for>0
and<0
which isBIT
datatype in SQL Server.
– Sami
yesterday
Can't you just create a computed column for that?
– Sami
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have certain values that are needed for validation in Forms, either they look like Value X >= 0
but it could also be X <= 0
, it depends on what operator should be used. How can I store such a value?
(I use MS SQL Server + Access as Frontend)
I basicly wanna store the Value and if it needs to be bigger than or smaller than.
sql-server ms-access
I have certain values that are needed for validation in Forms, either they look like Value X >= 0
but it could also be X <= 0
, it depends on what operator should be used. How can I store such a value?
(I use MS SQL Server + Access as Frontend)
I basicly wanna store the Value and if it needs to be bigger than or smaller than.
sql-server ms-access
sql-server ms-access
asked yesterday
Badgy
879320
879320
How then you would use those values after you store them? What are you trying to do? just store them and that's it?
– Sami
yesterday
@Sami I wanna use them for conditional Formatting, ergo the field value needs to be<= 0
just as an example
– Badgy
yesterday
It seems to (if I understand) that you just need a booleanTRUE/FALSE
for>0
and<0
which isBIT
datatype in SQL Server.
– Sami
yesterday
Can't you just create a computed column for that?
– Sami
yesterday
add a comment |
How then you would use those values after you store them? What are you trying to do? just store them and that's it?
– Sami
yesterday
@Sami I wanna use them for conditional Formatting, ergo the field value needs to be<= 0
just as an example
– Badgy
yesterday
It seems to (if I understand) that you just need a booleanTRUE/FALSE
for>0
and<0
which isBIT
datatype in SQL Server.
– Sami
yesterday
Can't you just create a computed column for that?
– Sami
yesterday
How then you would use those values after you store them? What are you trying to do? just store them and that's it?
– Sami
yesterday
How then you would use those values after you store them? What are you trying to do? just store them and that's it?
– Sami
yesterday
@Sami I wanna use them for conditional Formatting, ergo the field value needs to be
<= 0
just as an example– Badgy
yesterday
@Sami I wanna use them for conditional Formatting, ergo the field value needs to be
<= 0
just as an example– Badgy
yesterday
It seems to (if I understand) that you just need a boolean
TRUE/FALSE
for >0
and <0
which is BIT
datatype in SQL Server.– Sami
yesterday
It seems to (if I understand) that you just need a boolean
TRUE/FALSE
for >0
and <0
which is BIT
datatype in SQL Server.– Sami
yesterday
Can't you just create a computed column for that?
– Sami
yesterday
Can't you just create a computed column for that?
– Sami
yesterday
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
Store the value, as usual, in a field, and the operator in another field as Short Text.
The you can use Eval:
Result = Eval("" & [ValueField] & [OperatorField] & "0")
Okay thanks, I have this as the Conditional Formatting in one of the Cols for exampleEval("" & [EidamCI] & ELookup("Operator";"dbo_Rohstoffanalyse_Sollwerte";"Rohstoff = 'Eisenoxid' AND Messwertbezeichnung = 'EidamCI'";"Zeitpunkt DESC") & "0,2")
, problem is that this doesnt rly work, what does the function return? A boolean value or?
– Badgy
yesterday
ELookup is your own function, so can't tell, but I guess"0,2"
should read"0.2"
and semicolons perhaps commas.
– Gustav
yesterday
Thanks the0.2
solved it
– Badgy
yesterday
add a comment |
up vote
0
down vote
You can store your value as it is, and to check if this value is positive or not you have two ways
- First one
Create a computed column to check the Value
column as
CREATE TABLE YourTable(
YourValue INT,
IsPositive AS CASE WHEN YourValue < 0 THEN 0 ELSE 1 END
);
INSERT INTO YourTable (YourValue) VALUES
(1), (-1);
SELECT *
FROM YourTable;
- Second one
Use a CASE
expression (or even you can create a view) as
SELECT CASE WHEN YourValue < 0 THEN 0 ELSE 1 END IsPositive,
--...
FROM YourTable;
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Store the value, as usual, in a field, and the operator in another field as Short Text.
The you can use Eval:
Result = Eval("" & [ValueField] & [OperatorField] & "0")
Okay thanks, I have this as the Conditional Formatting in one of the Cols for exampleEval("" & [EidamCI] & ELookup("Operator";"dbo_Rohstoffanalyse_Sollwerte";"Rohstoff = 'Eisenoxid' AND Messwertbezeichnung = 'EidamCI'";"Zeitpunkt DESC") & "0,2")
, problem is that this doesnt rly work, what does the function return? A boolean value or?
– Badgy
yesterday
ELookup is your own function, so can't tell, but I guess"0,2"
should read"0.2"
and semicolons perhaps commas.
– Gustav
yesterday
Thanks the0.2
solved it
– Badgy
yesterday
add a comment |
up vote
0
down vote
accepted
Store the value, as usual, in a field, and the operator in another field as Short Text.
The you can use Eval:
Result = Eval("" & [ValueField] & [OperatorField] & "0")
Okay thanks, I have this as the Conditional Formatting in one of the Cols for exampleEval("" & [EidamCI] & ELookup("Operator";"dbo_Rohstoffanalyse_Sollwerte";"Rohstoff = 'Eisenoxid' AND Messwertbezeichnung = 'EidamCI'";"Zeitpunkt DESC") & "0,2")
, problem is that this doesnt rly work, what does the function return? A boolean value or?
– Badgy
yesterday
ELookup is your own function, so can't tell, but I guess"0,2"
should read"0.2"
and semicolons perhaps commas.
– Gustav
yesterday
Thanks the0.2
solved it
– Badgy
yesterday
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Store the value, as usual, in a field, and the operator in another field as Short Text.
The you can use Eval:
Result = Eval("" & [ValueField] & [OperatorField] & "0")
Store the value, as usual, in a field, and the operator in another field as Short Text.
The you can use Eval:
Result = Eval("" & [ValueField] & [OperatorField] & "0")
answered yesterday
Gustav
28.7k51734
28.7k51734
Okay thanks, I have this as the Conditional Formatting in one of the Cols for exampleEval("" & [EidamCI] & ELookup("Operator";"dbo_Rohstoffanalyse_Sollwerte";"Rohstoff = 'Eisenoxid' AND Messwertbezeichnung = 'EidamCI'";"Zeitpunkt DESC") & "0,2")
, problem is that this doesnt rly work, what does the function return? A boolean value or?
– Badgy
yesterday
ELookup is your own function, so can't tell, but I guess"0,2"
should read"0.2"
and semicolons perhaps commas.
– Gustav
yesterday
Thanks the0.2
solved it
– Badgy
yesterday
add a comment |
Okay thanks, I have this as the Conditional Formatting in one of the Cols for exampleEval("" & [EidamCI] & ELookup("Operator";"dbo_Rohstoffanalyse_Sollwerte";"Rohstoff = 'Eisenoxid' AND Messwertbezeichnung = 'EidamCI'";"Zeitpunkt DESC") & "0,2")
, problem is that this doesnt rly work, what does the function return? A boolean value or?
– Badgy
yesterday
ELookup is your own function, so can't tell, but I guess"0,2"
should read"0.2"
and semicolons perhaps commas.
– Gustav
yesterday
Thanks the0.2
solved it
– Badgy
yesterday
Okay thanks, I have this as the Conditional Formatting in one of the Cols for example
Eval("" & [EidamCI] & ELookup("Operator";"dbo_Rohstoffanalyse_Sollwerte";"Rohstoff = 'Eisenoxid' AND Messwertbezeichnung = 'EidamCI'";"Zeitpunkt DESC") & "0,2")
, problem is that this doesnt rly work, what does the function return? A boolean value or?– Badgy
yesterday
Okay thanks, I have this as the Conditional Formatting in one of the Cols for example
Eval("" & [EidamCI] & ELookup("Operator";"dbo_Rohstoffanalyse_Sollwerte";"Rohstoff = 'Eisenoxid' AND Messwertbezeichnung = 'EidamCI'";"Zeitpunkt DESC") & "0,2")
, problem is that this doesnt rly work, what does the function return? A boolean value or?– Badgy
yesterday
ELookup is your own function, so can't tell, but I guess
"0,2"
should read "0.2"
and semicolons perhaps commas.– Gustav
yesterday
ELookup is your own function, so can't tell, but I guess
"0,2"
should read "0.2"
and semicolons perhaps commas.– Gustav
yesterday
Thanks the
0.2
solved it– Badgy
yesterday
Thanks the
0.2
solved it– Badgy
yesterday
add a comment |
up vote
0
down vote
You can store your value as it is, and to check if this value is positive or not you have two ways
- First one
Create a computed column to check the Value
column as
CREATE TABLE YourTable(
YourValue INT,
IsPositive AS CASE WHEN YourValue < 0 THEN 0 ELSE 1 END
);
INSERT INTO YourTable (YourValue) VALUES
(1), (-1);
SELECT *
FROM YourTable;
- Second one
Use a CASE
expression (or even you can create a view) as
SELECT CASE WHEN YourValue < 0 THEN 0 ELSE 1 END IsPositive,
--...
FROM YourTable;
add a comment |
up vote
0
down vote
You can store your value as it is, and to check if this value is positive or not you have two ways
- First one
Create a computed column to check the Value
column as
CREATE TABLE YourTable(
YourValue INT,
IsPositive AS CASE WHEN YourValue < 0 THEN 0 ELSE 1 END
);
INSERT INTO YourTable (YourValue) VALUES
(1), (-1);
SELECT *
FROM YourTable;
- Second one
Use a CASE
expression (or even you can create a view) as
SELECT CASE WHEN YourValue < 0 THEN 0 ELSE 1 END IsPositive,
--...
FROM YourTable;
add a comment |
up vote
0
down vote
up vote
0
down vote
You can store your value as it is, and to check if this value is positive or not you have two ways
- First one
Create a computed column to check the Value
column as
CREATE TABLE YourTable(
YourValue INT,
IsPositive AS CASE WHEN YourValue < 0 THEN 0 ELSE 1 END
);
INSERT INTO YourTable (YourValue) VALUES
(1), (-1);
SELECT *
FROM YourTable;
- Second one
Use a CASE
expression (or even you can create a view) as
SELECT CASE WHEN YourValue < 0 THEN 0 ELSE 1 END IsPositive,
--...
FROM YourTable;
You can store your value as it is, and to check if this value is positive or not you have two ways
- First one
Create a computed column to check the Value
column as
CREATE TABLE YourTable(
YourValue INT,
IsPositive AS CASE WHEN YourValue < 0 THEN 0 ELSE 1 END
);
INSERT INTO YourTable (YourValue) VALUES
(1), (-1);
SELECT *
FROM YourTable;
- Second one
Use a CASE
expression (or even you can create a view) as
SELECT CASE WHEN YourValue < 0 THEN 0 ELSE 1 END IsPositive,
--...
FROM YourTable;
answered yesterday
Sami
6,26531038
6,26531038
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370375%2fstore-operators-like-or-in-microsoft-access%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How then you would use those values after you store them? What are you trying to do? just store them and that's it?
– Sami
yesterday
@Sami I wanna use them for conditional Formatting, ergo the field value needs to be
<= 0
just as an example– Badgy
yesterday
It seems to (if I understand) that you just need a boolean
TRUE/FALSE
for>0
and<0
which isBIT
datatype in SQL Server.– Sami
yesterday
Can't you just create a computed column for that?
– Sami
yesterday