Is date the problem or something else
From: Andy-TPCETC (AndyTPCETC_at_discussions.microsoft.com)
Date: 09/23/04
- Next message: William \(Bill\) Vaughn: "Re: Is date the problem or something else"
- Previous message: rogsonl: "Dataset cannot be updated or modified"
- Next in thread: William \(Bill\) Vaughn: "Re: Is date the problem or something else"
- Reply: William \(Bill\) Vaughn: "Re: Is date the problem or something else"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Sep 2004 13:41:03 -0700
The following inherited SQL is erroring out with a '3075-syntax error in date
in query experssion' Any help would be greatly appreciated.
Dim SQL As String
SQL = "SELECT DISTINCT [_program_enrollment].OFFICE_ID,
[_program_enrollment].program_enrollment_id, [_agent_unique].a_name,
[_program_enrollment].program_type, "
SQL = SQL & "[_program_enrollment].ENROLLMENT_COMPLETION_DATE,
[_agent_unique].LAST_NAME AS a_last, "
SQL = SQL & "[_agent_unique].FIRST_NAME AS a_first,
[_seeker_data].LAST_NAME, [_program_enrollment].exit_outcome, "
SQL = SQL & "[_seeker_data].FIRST_NAME, [_seeker_data].MIDDLE_INITIAL,
[_seeker_data].SSN, "
SQL = SQL & "[_seeker_data].address1, [_seeker_data].address2,
[_seeker_data].city, [_seeker_data].state, [_seeker_data].zip, "
SQL = SQL & "[_seeker_data].mailing_address1,
[_seeker_data].mailing_address2, [_seeker_data].mailing_city,
[_seeker_data].mailing_state, [_seeker_data].mailing_zip, "
SQL = SQL & "[_seeker_data].PRIMARY_PHONE, [_seeker_data].SECONDARY_PHONE,
[_seeker_data].selective_service_number, "
SQL = SQL & "[_seeker_data].emergency_contact_name,
[_seeker_data].emergency_contact_phone, [_program_enrollment].age, "
SQL = SQL & "[_seeker_data].EMAIL, [_seeker_data].gender,
[_seeker_data].date_of_birth, [_seeker_data].SEEKER_ID "
SQL = SQL & "FROM _seeker_data INNER JOIN ((htm_ofc_list INNER JOIN
_program_enrollment "
SQL = SQL & "ON [htm_ofc_list].OFFICE_ID = [_program_enrollment].OFFICE_ID)
INNER JOIN "
SQL = SQL & "_agent_unique ON [_program_enrollment].AGENT_ID =
[_agent_unique].agent_id) "
SQL = SQL & "ON [_seeker_data].SEEKER_ID = [_program_enrollment].SEEKER_ID "
SQL = SQL & "WHERE [_program_enrollment].OFFICE_ID = '" & Office & "' "
SQL = SQL & "And [_program_enrollment].exit_outcome <>'OTHER_INST' "
SQL = SQL & "And [_program_enrollment].exit_outcome <>'OTHER_HEALTH' "
SQL = SQL & "And [_program_enrollment].exit_outcome <>'OTHER_DECEASED' "
SQL = SQL & "And [_program_enrollment].exit_outcome Not Like '*RESERVIST*' "
SQL = SQL & "And [_program_enrollment].ENROLLMENT_COMPLETION_DATE >= #" &
Forms!Main_prep!txtRange_start & "# "
SQL = SQL & "And [_program_enrollment].ENROLLMENT_COMPLETION_DATE <= #" &
Forms!Main_prep!txtRange_end & "# "
SQL = SQL & "And [_program_enrollment].program_type like 'WIA*' "
SQL = SQL & "AND [_program_enrollment].program_type not like 'WIA NEG*' "
SQL = SQL & "AND [_program_enrollment].program_type not like 'WIA RAPID*' "
SQL = SQL & "AND [_program_enrollment].program_type not like 'WIA 10%*' "
SQL = SQL & "ORDER BY [_agent_unique].a_name,
[_program_enrollment].ENROLLMENT_COMPLETION_DATE"
Set RRs = db.OpenRecordset(SQL, dbOpenDynaset)
Runtime Error 3075
Syntax error in date expression
-- Thanks Andy
- Next message: William \(Bill\) Vaughn: "Re: Is date the problem or something else"
- Previous message: rogsonl: "Dataset cannot be updated or modified"
- Next in thread: William \(Bill\) Vaughn: "Re: Is date the problem or something else"
- Reply: William \(Bill\) Vaughn: "Re: Is date the problem or something else"
- Messages sorted by: [ date ] [ thread ]