# Thread: date functions

1. Registered User
Join Date
May 2002
Posts
395

## Unanswered: date functions

I know using DatePart("q", date) will return the # for the quarter. But how can I convert the quarter into a date? I would like a date function to return a beginning date.

q = DatePart("q", date)
If q = 1 Then
Me![Beginning Entry Date] = CDate("01/01/" & (DatePart("yyyy", Date)))
end if
if q = 2 then
Me![Beginning Entry Date] = CDate("03/01/" & (DatePart("yyyy", Date)))
end if
if ..

Is there a better way to accomplish this instead of hardcoding them?

THANKS!

2. Registered User
Join Date
Dec 2003
Location
Toronto, Ont. Canada
Posts
238

## Re: date functions

Originally posted by alicejwz
I know using DatePart("q", date) will return the # for the quarter. But how can I convert the quarter into a date? I would like a date function to return a beginning date.

q = DatePart("q", date)
If q = 1 Then
Me![Beginning Entry Date] = CDate("01/01/" & (DatePart("yyyy", Date)))
end if
if q = 2 then
Me![Beginning Entry Date] = CDate("03/01/" & (DatePart("yyyy", Date)))
end if
if ..

Is there a better way to accomplish this instead of hardcoding them?

THANKS!
To find the first day of the current quarter:
Me![Beginning Entry Date] = DateSerial(Year(Date()), Int((Month(Date()) - 1) / 3) * 3 + 1, 1)

I can't take credit for that one though... lol... Here's a Microsoft link that gives all kinds of date calculation expressions (including the one above)...
http://support.microsoft.com/default...b;en-us;210604

HTH
Last edited by Trudi; 12-16-03 at 20:57.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•