Hi friends
I am trying to write a Query that needs to have a date range of 60 days before the current date all the way through the last day of the year. Getting stumped on how I would do 60 days before the current date?
Thank you so much
Hi friends
I am trying to write a Query that needs to have a date range of 60 days before the current date all the way through the last day of the year. Getting stumped on how I would do 60 days before the current date?
Thank you so much
i use a form with 2 text boxes, txtStartDate, and txtEndDate. All queries look at these for the range.
your txtStartDate would be
=DateAdd("d",-60,Date())
Thank you very much ranman256 but I need from the beginning of the year to come to an end
This code has been used but has not worked
Code:=DateAdd("d";-60;Date()) And DateAdd("m";-2;Date())
60 days from today is Date()-60. What is your end date - today or the end of the year? The query would have Between Date()-60 And ???
Is it possible to describe it as an example?
Not sure what your question is. Post the SQL of your query and let us know which date is the "To" date.
Code:SELECT Payments.PaymentID, Payments.WorkorderID, Payments.PaymentAmount, Payments.PaymentDate, Workorders.CustomerID FROM Workorders LEFT JOIN Payments ON Workorders.WorkorderID = Payments.WorkorderID WHERE (((Payments.PaymentDate) Between DateAdd("d",-30,Date()) And DateAdd("m",-12,Date()))) ORDER BY Payments.PaymentDate;
This query is getting records for the past 12 months up until one month ago. The syntax looks right, but it is contradicting your previous posts. Are you trying to get the first of January?
For example, there are students attending the school lab once a month of the year. I recorded them in the database and recorded the date of attendance. What I want is who are those who did not attend?
Note I write before each student the date of attendance.
An example of this is late payments.
I was asked to take a look at this. I have two thoughts.
First, when using Between, I would always put the lesser value first. It will often work either way, but I have seen it fail. In other words, I'd reverse yours.
To your issue, it sounds like this query will return who did attend, and you want those who did not. If so, use the unmatched query wizard to compare this query to a table/query of all students. That should return those who did not attend.