- Total Members: 220,025
- Threads: 525,387
- Posts: 976,997
-
November 2nd, 2012, 02:33 PM
#1
Remove time from Date with Format. Lost ability to filter by date
Access 2010
Windows XP
I'm trying to remove the time from a date and time column and then sort the data by date. The data starts in the query named "Modified Data" under the column of "DateAndTime" and is moved into the query named "Ordered Data". My Query of "Ordered Data" is as follows:
SELECT Format([DateAndTime],"d /mm/ yyyy") AS RecordDate, [Modified Data].[0] AS Tag1, [Modified Data].[1] AS Tag2, [Modified Data].[2] AS Tag3, [Modified Data].[3] AS Tag4
FROM [Modified Data];
When I right click a value "DateAndTime" Column I get an option called "Date Filters" which implies that the data is formatted as a date and, I can sort it as such. When i click on the "RecordDate" Collumn in "Ordered Data" I get an option called "Text Filters" Which implies that the formatting was changed when I changed querys. How can I get rid of the time in my first query while still retaining the fact that access sees this as a date and I can filter based off of that fact?
Note: i have tried the following as my query file:
SELECT Format([DateAndTime],"Short Date") AS RecordDate, [Modified Data].[0] AS Tag1, [Modified Data].[1] AS Tag2, [Modified Data].[2] AS Tag3, [Modified Data].[3] AS Tag4
FROM [Modified Data];
-
November 2nd, 2012, 07:39 PM
#2
Format results in a string (text) value. Convert the value back to a date with CDate() function.
Or use Int() function to pull just the date part.
-
November 4th, 2012, 01:39 PM
#3
Thanks, I used CDate(Format(The rest of my code)) it worked perfectly.
Similar Threads
-
By antonyx in forum ASP Development
Replies: 5
Last Post: December 17th, 2011, 02:30 PM
-
By mcarrier in forum Microsoft Access Help
Replies: 4
Last Post: November 17th, 2011, 05:45 PM
-
By squirrelj in forum ASP Development
Replies: 2
Last Post: October 30th, 2006, 05:29 AM
-
By aish in forum .NET Development
Replies: 0
Last Post: April 24th, 2006, 01:52 AM
-
By okl in forum ASP Development
Replies: 17
Last Post: March 17th, 2005, 11:21 PM