Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
darkelf
Starting Member
2 Posts |
Posted - 2003-08-11 : 07:23:29
|
Hello guys.First my machine;Windows XPMS Access XPThe problem;One form with a field named cboCB (only two values D and G)one table (tblKMValues) with one field IDKM (values: 10, 20, 30, 40... till 200)One query from the table tblKMValues)on this query i what to do something like thisSelect IDKM IIF(cboCB = D;IDKM >=180;IDKM)From tblKMValuesResuming the thingIf the cboCB is D limit the IDKM to 180, IF cboCB is G show all.Thks for your help in advancedDarkElf |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-08-11 : 07:47:00
|
You need to do this in your WHERE clause:SELECT * FROM tblKMValuesWHERE cboCB = 'G' OR IDKM >=180That means:If cboCB <> 'G', then IDKM must be greater than or equal to 180.- Jeff |
 |
|
darkelf
Starting Member
2 Posts |
Posted - 2003-08-11 : 07:53:43
|
Hithaks for your fast reply. It works and it's so simple that i'm feel kind stupid.Darkelf |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-08-11 : 08:21:05
|
darkelf -- no problem... it's one of those things that is not obvious at all; implementing an "if-then" in a query's criteria is one of the most confusing things people do in SQL. Most assume a CASE or an IIF() is the way to go, but it's really not !- Jeff |
 |
|
|
|
|