Connecting Tech Pros Worldwide Help | Site Map

Function to Return 1st of Month

  #1  
Old April 19th, 2007, 04:06 PM
Newbie
 
Join Date: Mar 2007
Location: North Wales
Posts: 2
I have a form in Access with 2 date fields for completion. I want to query data from the 1st of the month (e.g. 01 April, 2007) to yesterday. For yesterday I use '=Date()-1', which works great but can't figure out what to use for the other date field.

Will I need to write a function to return this date? Will the function use 'Date' to retrieve the information or will it use the date field box name?

Hope you can help with this, it is driving me crazy!

Last edited by Quazzie; April 19th, 2007 at 04:07 PM. Reason: Spelling mistake
  #2  
Old April 19th, 2007, 05:05 PM
Rabbit's Avatar
Expert
 
Join Date: Jan 2007
Location: California
Posts: 3,837

re: Function to Return 1st of Month


This will return the first day of the current month of the current year.
Expand|Select|Wrap|Line Numbers
  1. CDate(Month(Date()) & "/1/" & Year(Date()))
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing color of calendar dates gubbachchi answers 4 March 1st, 2008 02:26 AM
Acc97: finding end-of-week and end-of-month dates planetthoughtful answers 2 April 5th, 2006 08:35 AM
day of month Prophet answers 10 January 5th, 2006 04:55 AM
Find day of week from month and year Laguna answers 20 September 15th, 2005 03:15 AM