If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
1st Of Every Month
Hi,
I'm trying to build a query that gives me the first day of the current month. This is what I currently have: When I run my query it returns 10/1/06 and I want 11/1/06 DateAdd("m",-1,Date()-Day(Date()))+1 I try using the same concept as I use in SQL2K but it did not work. This is what I use for SQL2K and it work like a charm but I'm not really familiar with access. convert(varchar,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0),101) as data_date Please help Thanks |
#2
|
|||
|
|||
1st Of Every Month
OK I got it...
I had to break the function in two. DateAdd("m",0,Date())-Day(Date()) "Jose Aleman" wrote: Hi, I'm trying to build a query that gives me the first day of the current month. This is what I currently have: When I run my query it returns 10/1/06 and I want 11/1/06 DateAdd("m",-1,Date()-Day(Date()))+1 I try using the same concept as I use in SQL2K but it did not work. This is what I use for SQL2K and it work like a charm but I'm not really familiar with access. convert(varchar,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0),101) as data_date Please help Thanks |
#3
|
|||
|
|||
1st Of Every Month
Jose
Another approach would be: DateSerial(Year(Date()), Month(Date()), 1) Regards Jeff Boyce Microsoft Office/Access MVP "Jose Aleman" wrote in message ... Hi, I'm trying to build a query that gives me the first day of the current month. This is what I currently have: When I run my query it returns 10/1/06 and I want 11/1/06 DateAdd("m",-1,Date()-Day(Date()))+1 I try using the same concept as I use in SQL2K but it did not work. This is what I use for SQL2K and it work like a charm but I'm not really familiar with access. convert(varchar,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0),101) as data_date Please help Thanks |
Thread Tools | |
Display Modes | |
|
|