Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If statement and QBE

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
Trying like the Devil to put an If statement the QBE grid with no success.

I have a Query that contains Shour and Ehour, and a duration field, and I am using that query as Input to a new query.
In the QBE grid I want to create a new column based on:
If Shour<Ehour then (NewColName) =duration.

I looked on the web and can't detemine if the IF is allowed in QBE, and if so, how do you use it.

I can export the first query to EXCEL and do the IF statement in there, but it would be cool if I could do it in ACCESS and save the trouble.

Thanks in advance

jpl

 


Hi,

IMMEDIATE IF...
Code:
[b]IIf[/b](Shour<Ehour,duration,0)
[tt]
If Shour < Ehour then
duration
Else
0
End
[/tt]

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top