In an Access query, I select the dates below premier days of current month (eg. <01/04/2009). This is a request to be made every month.
What words to use, other than eg. <#01/04/09#, to be established once and for all.
In an Access query, I select the dates below premier days of current month (eg. <01/04/2009). This is a request to be made every month.
What words to use, other than eg. <#01/04/09#, to be established once and for all.
How about
<cdate("01/" & Month(date()) & "/" & year(date()))
Having had a very basic training for ACCESS, I will still call on your knowledge to me translate a phrase. I have to select the records where the dates are more than the last day of the month (eg >28/02/2009) or null. How to express this request unless:
Is Null Or> #28/02/2009 #
so that it is fixed once and for all.
Can you explain what is meant by the expression that you gave me earlier: "01/" and "/"
For the last day of the month is a bit more complicated. The easiest way to remove 1 being the first day of the month (the next being, no matter), history of getting the 31, 30, 29 or 28 depending on the month.
In fact what I do is that I built date. The "&" is a concatenation of values. The CDate() converts a variable to date variable (required to filter on values of type date)
So:
- Date() = today's date.
- Month(Date()) = month of the date. Returns 3
- Year(Date()) = The years of the date. 2009 Returns
If you concatenate all this with "&":
- "01/" & Month(Date()) & "/" & year(date()) = 01/3/2009
But it remains in the form of string. To convert it into a date, you put a CDate() to:
- CDate ( "01/" & Month(Date()) & "/" & year(date())) = dated 01/03/2009.
I wrote this:
Is Null Or > CDate ( "01/" & Month(Date()) & "/" & Year(Date())) - 1
apparently it works.
Bookmarks