Hello Everyone,
I am having an issue with getting a parameter query to work in VBA code. I have the Between (Date) And (Date) to work but cannot get the >= (Date) to work. The date is based on table fields they enter in at night. I do not use a form since a form does not save dates entered upon close. Any suggestions would be much appreciated, Thanks in advance.
Set rs = New ADODB.Recordset
rs.Open _
"Select * FROM tblInputDate;", _
ActiveConnection:=CurrentProject.Connection
strSQL = "INSERT INTO tblGroupRenewal ( PLATFORM_CD, BLK_BUS_CD, GRP_NBR, MSTR_RPT_NBR, GRP_RESET_DT, GRP_TERM_DT ) " _
& "SELECT PLATFORM_CD, BLK_BUS_CD, Val([GRP_ID]) AS GRP_NBR, MSTR_RPT_NBR, GRP_RESET_DT, GRP_TERM_DT " _
& "FROM HUM_CPDGROUP " _
& "WHERE (((PLATFORM_CD)='EM') AND ((BLK_BUS_CD)='GR') AND ((GRP_RESET_DT) Between #" & rs("BeginDate") & "# And #" & rs("EndDate") & "#) AND ((GRP_TERM_DT) Is Null Or (GRP_TERM_DT) >= #" rs("TermDate") & "#)" - That is the area of error occurring, first portion works.
I am having an issue with getting a parameter query to work in VBA code. I have the Between (Date) And (Date) to work but cannot get the >= (Date) to work. The date is based on table fields they enter in at night. I do not use a form since a form does not save dates entered upon close. Any suggestions would be much appreciated, Thanks in advance.
Set rs = New ADODB.Recordset
rs.Open _
"Select * FROM tblInputDate;", _
ActiveConnection:=CurrentProject.Connection
strSQL = "INSERT INTO tblGroupRenewal ( PLATFORM_CD, BLK_BUS_CD, GRP_NBR, MSTR_RPT_NBR, GRP_RESET_DT, GRP_TERM_DT ) " _
& "SELECT PLATFORM_CD, BLK_BUS_CD, Val([GRP_ID]) AS GRP_NBR, MSTR_RPT_NBR, GRP_RESET_DT, GRP_TERM_DT " _
& "FROM HUM_CPDGROUP " _
& "WHERE (((PLATFORM_CD)='EM') AND ((BLK_BUS_CD)='GR') AND ((GRP_RESET_DT) Between #" & rs("BeginDate") & "# And #" & rs("EndDate") & "#) AND ((GRP_TERM_DT) Is Null Or (GRP_TERM_DT) >= #" rs("TermDate") & "#)" - That is the area of error occurring, first portion works.
