Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating the first date of the month 2

Status
Not open for further replies.

balllian

MIS
Jan 26, 2005
150
GB
is it possible to create a scenario when running an append query that a date is added into the table which always shows the first date of the current month. ie. if it was run tmrw it would show 01/03/05.

Thanks in advance

Ian
 
dateserial(year(now(), month(now()),1) should give the first day of this month
 
it has come back with the following error

'The expression you entered has a function containing the wrong numbers of arguements'
 
You can use this

YourDate =DateAdd("d",-(Day(Date())-1),Date())

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
My apologies - mismatched brackets

dateserial(year(now()[red])[/red], month(now()),1)
 
This is the SQL i am using as u can see there is no date field here.

SELECT QRolling_info_revised.[Type of Breach], [CountOfType of Breach]/6 AS Total
FROM QRolling_info_revised;

where do i need to add this in so that the first date of the month also populate my results.

I hope this makes sense.

Ian
 
Change SQL to this.
[tt]
SELECT QRolling_info_revised.[Type of Breach], [CountOfType of Breach]/6 AS Total,DateAdd("d",-(Day(Date())-1),Date()) AS MyDate FROM QRolling_info_revised;
[/tt]

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top