Great community. Great ideas.
Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.
November 2nd, 2012, 02:33 PM
Remove time from Date with Format. Lost ability to filter by date
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]. AS Tag1, [Modified Data]. AS Tag2, [Modified Data]. AS Tag3, [Modified Data]. 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]. AS Tag1, [Modified Data]. AS Tag2, [Modified Data]. AS Tag3, [Modified Data]. AS Tag4
FROM [Modified Data];
November 2nd, 2012, 07:39 PM
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
Thanks, I used CDate(Format(The rest of my code)) it worked perfectly.
By antonyx in forum ASP Development
Last Post: December 17th, 2011, 02:30 PM
By mcarrier in forum Microsoft Access Help
Last Post: November 17th, 2011, 05:45 PM
By squirrelj in forum ASP Development
Last Post: October 30th, 2006, 05:29 AM
By aish in forum .NET Development
Last Post: April 24th, 2006, 01:52 AM
By okl in forum ASP Development
Last Post: March 17th, 2005, 11:21 PM