AnthonyJ20
Programmer
Hello everyone. What I'm trying to do is use one SQL Statement to pull not only the current month's data but also that of the previous month. Really is it possible, and if so, What in the world would it look like. Below is the SQL statement that I want to transform. I currently have two variables called MyDate and MyDate2 which control what the output will be. Anyone with an idea?
Sql = "SELECT * from CustomerBoxes,tblDataTableNew " _
& "Where CustomerBoxes.CustomerID = tblDataTableNew.DataTable AND VolDate >= #" & MyDate & "# AND VolDate <= #" & MyDate2 & "# AND FullPay + ImageItems > 0 " _
& "Order By CustomerBoxes.CustomerName,tblDataTableNew.CustomerName,tblDataTableNew.VolDate "
currentArtist = ""
set rs = Cnt.execute(sql)
Sql = "SELECT * from CustomerBoxes,tblDataTableNew " _
& "Where CustomerBoxes.CustomerID = tblDataTableNew.DataTable AND VolDate >= #" & MyDate & "# AND VolDate <= #" & MyDate2 & "# AND FullPay + ImageItems > 0 " _
& "Order By CustomerBoxes.CustomerName,tblDataTableNew.CustomerName,tblDataTableNew.VolDate "
currentArtist = ""
set rs = Cnt.execute(sql)