Hi,
I read a lot of topics about this via Google but I have not find the solution of my problem.
So, I am writing a SQL request with VBA and dates are the problem. Below a working code :
Howether, when I want to go with variable for the Dates, it s not working any more, with the Error 3075 :
The 2 variable Date_End and Date_Beg are Dates.
I have also tried Format(Date_End, "dd mm yyyy") and Cdate(Date_End).
Does someone know what I have done wrong ?
Thanks for your assistance !
I read a lot of topics about this via Google but I have not find the solution of my problem.
So, I am writing a SQL request with VBA and dates are the problem. Below a working code :
Code:
Qry_Where = " WHERE " & _
"(Table1.[" & Champ_Date & "] > Table2.[" & Champ_Date & "] " & _
"AND Table1.[" & Champ_Date & "] <= #19/11/2015# " & _
"AND Table2.[" & Champ_Date & "] >= #31/10/2015#) "
Code:
Qry_Where = " WHERE " & _
"(Table1.[" & Champ_Date & "] > Table2.[" & Champ_Date & "] " & _
"AND Table1.[" & Champ_Date & "] <= #" & CDate(Date_End) & "# " & _
"AND Table2.[" & Champ_Date & "] >= #" & CDate(Date_Beg) & "#) "
The 2 variable Date_End and Date_Beg are Dates.
I have also tried Format(Date_End, "dd mm yyyy") and Cdate(Date_End).
Does someone know what I have done wrong ?
Thanks for your assistance !