Nov 15, 2004 #1 pungigi Programmer Oct 29, 2003 115 US Can I do some kind of if then in a query??? What I am doing is Trip Status = S1, SQ or SR Trip Type countif R then 2 else 1 What I need is to be able to get information based on above TWO criterias.
Can I do some kind of if then in a query??? What I am doing is Trip Status = S1, SQ or SR Trip Type countif R then 2 else 1 What I need is to be able to get information based on above TWO criterias.
Nov 15, 2004 #2 PHV MIS Nov 8, 2002 53,708 FR Take a look at the SQL In operator and at the IIf function: WHERE [Trip Status] In ('S1', 'SQ', 'SR') Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Take a look at the SQL In operator and at the IIf function: WHERE [Trip Status] In ('S1', 'SQ', 'SR') Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Nov 15, 2004 #3 Lothario Programmer Nov 3, 2004 407 US use CASE statement... Something like this... CASE WHEN Trip Type= 'R' THEN blahblah=2 Else blahblah=1 END -L Upvote 0 Downvote
use CASE statement... Something like this... CASE WHEN Trip Type= 'R' THEN blahblah=2 Else blahblah=1 END -L
Nov 15, 2004 #4 PHV MIS Nov 8, 2002 53,708 FR Lothario, CASE is OK for passthru query to an Ansi SQL compliant RDBMS, not for regular JetSQL. The Access way is IIf. Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Lothario, CASE is OK for passthru query to an Ansi SQL compliant RDBMS, not for regular JetSQL. The Access way is IIf. Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Nov 15, 2004 #5 Lothario Programmer Nov 3, 2004 407 US Thanks PHV... I thought i was replying in the SQL Server programming forum... -L Upvote 0 Downvote