Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / December 2005

Tip: Looking for answers? Try searching our database.

Format Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Kaendera - 07 Dec 2005 20:41 GMT
I want to be able to format the date for my query that asks a user to enter a
date. The date is stored a date/time field. I want my users to only enter the
date and not the time. The data is  captured and stored as a date/time field
in the database table. Here is my user prompt. [PLEASE ENTER DATE] Here is
how the date is stored in the table  "01/09/2004 1:35:47 PM" . I want the
query to strip off the time.
Ofer - 07 Dec 2005 21:06 GMT
Try using the DateValue function to remove the time

Select DateField From TableName Where DateValue(DateField) = [Please Enter
Date]

Signature

Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck

> I want to be able to format the date for my query that asks a user to enter a
> date. The date is stored a date/time field. I want my users to only enter the
> date and not the time. The data is  captured and stored as a date/time field
> in the database table. Here is my user prompt. [PLEASE ENTER DATE] Here is
> how the date is stored in the table  "01/09/2004 1:35:47 PM" . I want the
> query to strip off the time.
John Spencer - 07 Dec 2005 21:11 GMT
Use the DateValue function on the stored field.

Field: DateOnly: DateValue(YourDateField)
Criteria: CDate([Please Enter Date])

>I want to be able to format the date for my query that asks a user to enter
>a
[quoted text clipped - 5 lines]
> how the date is stored in the table  "01/09/2004 1:35:47 PM" . I want the
> query to strip off the time.
Van T. Dinh - 08 Dec 2005 02:43 GMT
If I understand your question correctly, you wantthe user to enter a date
value and the Query will select all records for that date regardless of the
time associated with the date in the Record, the you can use the following
in the criteria row of the DateFieldColumn in your Query grid:

>= [PLEASE ENTER DATE] And < ([PLEASE ENTER DATE] + 1)

Signature

HTH
Van T. Dinh
MVP (Access)

>I want to be able to format the date for my query that asks a user to enter
>a
[quoted text clipped - 5 lines]
> how the date is stored in the table  "01/09/2004 1:35:47 PM" . I want the
> query to strip off the time.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.