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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf statement in query design grid

Status
Not open for further replies.

2Plan

MIS
Mar 29, 2005
55
US
How can I write this query in the "MS Access Query Design Grid"

IIf DepartDiff > 330 place "Late" in field
IIf DepartDiff < -30 place "Early" in field
Else place "On-Time" in field

Here's a copy of what I have so far:

SELECT [0601sa].A_Time, Format(TimeSerial(Mid$([A_Time],1,2),Mid$([A_Time],3,2),Mid$([A_Time],5,2)),"Long Time") AS ConvArrive, [0601sa].D_Time, Format(TimeSerial(Mid$([D_Time],1,2),Mid$([D_Time],3,2),Mid$([D_Time],5,2)),"Long Time") AS ConvDepart, [0601sa].Schd, Format(TimeSerial(Mid$([Schd],1,2),Mid$([Schd],3,2),0),"Medium Time") AS ConvSchd, DateDiff("s",[ConvSchd],[ConvDepart]) AS DepartDiff, DateSerial(Mid(Trim([aDate]),5,2),Left(Trim([aDate]),2),Mid(Trim([aDate]),3,2)) AS acDate, Format(TimeSerial(Mid$([Trip],1,2),Mid$([Trip],3,2),0),"Medium Time") AS ConvTrip INTO cmtaJan06_trp
FROM 0601sa;
 
IIf(DepartDiff > 330,"Late",IIf(DepartDiff < -30, "Early", "On-Time"))

-Coco

[auto]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top