J
Jeremy Ames
I want to build a query that shows the last day of the month for a given
date. I know how to use DateAdd and DatePart functions to create this is
module lebel code, but I want this information in a query. This is the code
that I am currently using in a module:
dim lDate as long, nMonth as int, sReturnDate as string
lDate = DateAdd("m", 1, SalesDate)
nMonth = DatePart("m", lDate)
sReturnDate = DateAdd("d", -1, nMonth & "/1/" & datepart("y", SalesDate))
That returns the correct date, but I cannot figure out how to do it in a
query. Any help would be greatly appreciated.
Thanks in advance,
Jeremy Ames
date. I know how to use DateAdd and DatePart functions to create this is
module lebel code, but I want this information in a query. This is the code
that I am currently using in a module:
dim lDate as long, nMonth as int, sReturnDate as string
lDate = DateAdd("m", 1, SalesDate)
nMonth = DatePart("m", lDate)
sReturnDate = DateAdd("d", -1, nMonth & "/1/" & datepart("y", SalesDate))
That returns the correct date, but I cannot figure out how to do it in a
query. Any help would be greatly appreciated.
Thanks in advance,
Jeremy Ames