Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to change a Field Type in a query?

Posted on 2008-10-10
3
Medium Priority
?
1,264 Views
Last Modified: 2012-05-05
I have Access Table with columns [Variable] and [Contents]
Contents is of Type Text
I could have this data in my table:

Variable  | Contents
Name      | Joe
SubDate | 10/1/2008
Name     | Mary
SubDate | 10/5/2008
Name     | Tom
SubDate | 10/2/2008
I need to query for SubDate but convert the results to DateTime.
Is such a query possible?
If not what might be a work around?
I have thought of using a compound query that first appends SubDate to a Temp table TempDates
and then joins TempDates.SubDate to another query returning SubDate as a DateTime.
This is trying to populate a GridView from a date range and it seems I need to be using DateTime
and not Text for SubDate.
0
Comment
Question by:RalphHxyz
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 22687167

select [Name], cdate([subDate])
from tableX
0
 

Author Comment

by:RalphHxyz
ID: 22687524
Thank you, what is cdate()?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22687576
cdate(exp)  converts exp that can be interpreted as date to real date
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question