P
Pietro
Hi,
I'm trying to change the form source through a VB code,I've a problem
that i cannot put the whole SQL code in one line,can you help ?
The SCL is:
Form.RecordSource = "SELECT CapAll.ID AS Code, CapAll.[Service Request] AS
SR, CapAll.Subject, CapAll.Turn, CapAll.Language, CapAll.Received,
CapAll.Replied, CapAll.Delayed, IIf([delayed]=1,’Delayed’,’On Time’) AS Tipo,
IIf(Mid([Turn],1,13)=‘Investigation’,’Investigation’,’24hrs CBR’) AS Class,
Format(IIf((DateDiff(‘s’,[received],Now())/3600)>24,0,24-(DateDiff(‘s’,[received],Now())/3600)),’00.00000’)
AS HRS, Format(Trim(Mid([HRS],InStr([HRS],’.’)+1/100000))*60,’00.00000’) AS
MNT, Format(Trim(Mid([MNT],InStr([MNT],’.’)+1/100000))*60,’00.00000’) AS SCS,
Left([hrs],2) & ‘:’ & Left([mnt],2) & ‘:’ & Left([scs],2) AS TimeLeft,
IIf([subject]=‘XCD CAR CONTACT’,’Care Contact’,’Escalations’) AS Type FROM
CapAll"
WHERE (((CapAll.Language)=[forms]![queue]![language2] Or
[forms]![queue]![language2] Is Null) AND ((IIf([delayed]=1,’Delayed’,’On
Time’))=[forms]![queue]![Tipo2] Or [forms]![queue]![Tipo2] Is Null) AND
((IIf(Mid([Turn],1,13)=‘Investigation’,’Investigation’,’24hrs
CBR’))=[forms]![queue]![Class2] Or [forms]![queue]![Class2] Is Null) AND
((Status)=‘Open’) AND ((IIf([subject]=‘XCD CAR CONTACT’,’Care
Contact’,’Escalations’))=[forms]![queue]![Type2] Or [forms]![queue]![Type2]
Is Null))ORDER BY CapAll.Received;"
I'm trying to change the form source through a VB code,I've a problem
that i cannot put the whole SQL code in one line,can you help ?
The SCL is:
Form.RecordSource = "SELECT CapAll.ID AS Code, CapAll.[Service Request] AS
SR, CapAll.Subject, CapAll.Turn, CapAll.Language, CapAll.Received,
CapAll.Replied, CapAll.Delayed, IIf([delayed]=1,’Delayed’,’On Time’) AS Tipo,
IIf(Mid([Turn],1,13)=‘Investigation’,’Investigation’,’24hrs CBR’) AS Class,
Format(IIf((DateDiff(‘s’,[received],Now())/3600)>24,0,24-(DateDiff(‘s’,[received],Now())/3600)),’00.00000’)
AS HRS, Format(Trim(Mid([HRS],InStr([HRS],’.’)+1/100000))*60,’00.00000’) AS
MNT, Format(Trim(Mid([MNT],InStr([MNT],’.’)+1/100000))*60,’00.00000’) AS SCS,
Left([hrs],2) & ‘:’ & Left([mnt],2) & ‘:’ & Left([scs],2) AS TimeLeft,
IIf([subject]=‘XCD CAR CONTACT’,’Care Contact’,’Escalations’) AS Type FROM
CapAll"
WHERE (((CapAll.Language)=[forms]![queue]![language2] Or
[forms]![queue]![language2] Is Null) AND ((IIf([delayed]=1,’Delayed’,’On
Time’))=[forms]![queue]![Tipo2] Or [forms]![queue]![Tipo2] Is Null) AND
((IIf(Mid([Turn],1,13)=‘Investigation’,’Investigation’,’24hrs
CBR’))=[forms]![queue]![Class2] Or [forms]![queue]![Class2] Is Null) AND
((Status)=‘Open’) AND ((IIf([subject]=‘XCD CAR CONTACT’,’Care
Contact’,’Escalations’))=[forms]![queue]![Type2] Or [forms]![queue]![Type2]
Is Null))ORDER BY CapAll.Received;"