Solved

How to change a Field Type in a query?

Posted on 2008-10-10
3
1,174 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 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 22687167

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

Author Comment

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

Expert Comment

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now