Connecting Tech Pros Worldwide Help | Site Map

Function to Return 1st of Month

 
LinkBack Thread Tools Search this Thread
  #1  
Old April 19th, 2007, 03:06 PM
Newbie
 
Join Date: Mar 2007
Location: North Wales
Posts: 2
Default Function to Return 1st of Month

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 03:07 PM. Reason: Spelling mistake
Reply
  #2  
Old April 19th, 2007, 04:05 PM
Rabbit's Avatar
Expert
 
Join Date: Jan 2007
Location: California
Age: 24
Posts: 3,820
Default

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.