D
Daniel Melero
Hi, I'm getting that error message when I am executing a
query.
SQLquery = "SELECT tbl_call_log.Shipper, Nz([tbl_locn].
[District]) AS District, tbl_call_log.Dest_Unit, "
SQLquery = SQLquery & "tbl_call_log.ID, Nz
([tbl_call_log].[SCAC]) AS SCAC,
tbl_call_log.Late_Ctgy_Maj, "
SQLquery = SQLquery & "tbl_call_log.Late_Ctgy_Sub,
tbl_call_log.Delay_Unit, tbl_call_log.Orig_Appt_Dt, "
SQLquery = SQLquery & "tbl_call_log.Booking_Number,
tbl_call_log.Orig_Appt_Tm, tbl_call_log.Contact_Orig, "
SQLquery = SQLquery & "tbl_call_log.Rev_Appt_Dt,
tbl_call_log.Rev_Appt_Tm, tbl_call_log.Cust_Rev_Appt_Dt,
tbl_call_log.Cust_Rev_Appt_Tm, tbl_call_log.Act_Del_Dt,
tbl_call_log.Act_Del_Tm "
SQLquery = SQLquery & " FROM tbl_locn INNER JOIN
tbl_call_log ON tbl_locn.Dest_Unit =
tbl_call_log.Dest_Unit"
SQLquery = SQLquery & " GROUP BY tbl_call_log.Shipper,
Nz([tbl_locn].[District]), tbl_call_log.Dest_Unit, "
SQLquery = SQLquery & "tbl_call_log.ID, Nz
([tbl_call_log].[SCAC]), tbl_call_log.Late_Ctgy_Maj,
tbl_call_log.Late_Ctgy_Sub, "
SQLquery = SQLquery & "tbl_call_log.Delay_Unit,
tbl_call_log.Orig_Appt_Dt, tbl_call_log.Booking_Number,
tbl_call_log.Orig_Appt_Tm, "
SQLquery = SQLquery & "tbl_call_log.Contact_Orig,
tbl_call_log.Rev_Appt_Dt, tbl_call_log.Rev_Appt_Tm,
tbl_call_log.Cust_Rev_Appt_Dt, "
SQLquery = SQLquery & "tbl_call_log.Cust_Rev_Appt_Tm,
tbl_call_log.Act_Del_Dt, tbl_call_log.Act_Del_Tm"
SQLquery = SQLquery & HavingString
SQLquery = SQLquery & " ORDER BY tbl_call_log.Shipper,
tbl_call_log.Dest_Unit, tbl_call_log.Orig_Appt_Dt,
tbl_call_log.Booking_Number;"
Set rs = db.OpenRecordset(SQLquery, dbOpenDynaset)
Can someone help? Thanks in advance.
query.
SQLquery = "SELECT tbl_call_log.Shipper, Nz([tbl_locn].
[District]) AS District, tbl_call_log.Dest_Unit, "
SQLquery = SQLquery & "tbl_call_log.ID, Nz
([tbl_call_log].[SCAC]) AS SCAC,
tbl_call_log.Late_Ctgy_Maj, "
SQLquery = SQLquery & "tbl_call_log.Late_Ctgy_Sub,
tbl_call_log.Delay_Unit, tbl_call_log.Orig_Appt_Dt, "
SQLquery = SQLquery & "tbl_call_log.Booking_Number,
tbl_call_log.Orig_Appt_Tm, tbl_call_log.Contact_Orig, "
SQLquery = SQLquery & "tbl_call_log.Rev_Appt_Dt,
tbl_call_log.Rev_Appt_Tm, tbl_call_log.Cust_Rev_Appt_Dt,
tbl_call_log.Cust_Rev_Appt_Tm, tbl_call_log.Act_Del_Dt,
tbl_call_log.Act_Del_Tm "
SQLquery = SQLquery & " FROM tbl_locn INNER JOIN
tbl_call_log ON tbl_locn.Dest_Unit =
tbl_call_log.Dest_Unit"
SQLquery = SQLquery & " GROUP BY tbl_call_log.Shipper,
Nz([tbl_locn].[District]), tbl_call_log.Dest_Unit, "
SQLquery = SQLquery & "tbl_call_log.ID, Nz
([tbl_call_log].[SCAC]), tbl_call_log.Late_Ctgy_Maj,
tbl_call_log.Late_Ctgy_Sub, "
SQLquery = SQLquery & "tbl_call_log.Delay_Unit,
tbl_call_log.Orig_Appt_Dt, tbl_call_log.Booking_Number,
tbl_call_log.Orig_Appt_Tm, "
SQLquery = SQLquery & "tbl_call_log.Contact_Orig,
tbl_call_log.Rev_Appt_Dt, tbl_call_log.Rev_Appt_Tm,
tbl_call_log.Cust_Rev_Appt_Dt, "
SQLquery = SQLquery & "tbl_call_log.Cust_Rev_Appt_Tm,
tbl_call_log.Act_Del_Dt, tbl_call_log.Act_Del_Tm"
SQLquery = SQLquery & HavingString
SQLquery = SQLquery & " ORDER BY tbl_call_log.Shipper,
tbl_call_log.Dest_Unit, tbl_call_log.Orig_Appt_Dt,
tbl_call_log.Booking_Number;"
Set rs = db.OpenRecordset(SQLquery, dbOpenDynaset)
Can someone help? Thanks in advance.