PDA

View Full Version : SQL statement help


mat41
02-24-2009, 02:51 AM
Having toruble doing this in access 2003:

SELECT......., IIf([Days Opened]>[SLA Agreement],"Yes","No") AS [Has Meet SLA]
FROM tbleName.....

Specifically my issue is with:

IIf([Days Opened]>[SLA Agreement],"Yes","No") AS [Has Meet SLA]

I am getting an 'out of disk space in temp location error' I know I am not out of disk space. Does it matter if there are no values in some of the 'Days Opened' or 'SLA Agreement' fields? Any assitance getting this working while allowing empty field values would be great. NOTE they are both number data types.

TYIA

mat41
02-24-2009, 11:29 PM
I ended up getting this working:

SWITCH
(
[Days Opened] <= TBL_SLA_Activity.[Number of Days] , 'YES',
[Days Opened] > TBL_SLA_Activity.[Number of Days] , 'NO',
TRUE, 'N/A'
) AS [Has Meet SLA]

I have this in my query:

datediff("d",[DateTime],[mmmm.maxdate]) AS [Days Opened]

I would like to exclude any sat or sun in the date range. Any ideas on this?

TYIA