Topics Search

Convert Numeric Value to Date

Convert Numeric Value to Date
Views: 2
I’m having some difficulty trying to convert a numeric value into a date.

The table is link to a txt field. I’m unable to change the data type.

The numeric value that I’m working with looks like “20080911”

I tried using formula:

Format(DateSerial(Left([due date],4),Mid([due date],5,2),Right([due date],2)),"y-mm-dd")

When I run the query, I received the dreaded “Data mistype” error message.
Sponsored Links:

More topics

 

Convert a date to a numeric value

Preview
In Access 2003/XP/2000/97, how do you change the date into a numeric value?
 

Date Conversion

Preview
I am trying to convert a date in the text format to Date format using the CDate() function in a sql query in MS Access, which is working fine. But when I try to export the results to a an excel file, the date is being displayed as text field again.

How do I correctly convert & format the text values and then export the values as Date (Numeric) in to Excel?

And the date is in the UK format 'dd/mm/y'
 

Convert date format yyyymmdd for datediff

Preview
I am trying to convert a numeric date formated yyyymmdd to a format that the DateDiff function will accept.
 

Convert Text and Numeric in query

Preview
I have a query the appends an access database from an excel spreadsheet (via a link in Access) taken from another program. My problem is that one of the excel columns contains both text and numeric data and I keep getting a 'data mismatch'. I would like to convert both to text I have tried a number of options
exp2:csng([Zip Code])
exp2:Str([Zip Code])
none seem to work
 

Sql to convert date into different format

Preview
I have a column within a table (Lead) where the current date (CreatedDate) format is 2011-04-04T17:24:57.000Z. I'm looking to convert this to mm/dd/y. I tried to use convert, but I fear I'm using this incorrectly.
 

Converting date field in numbers

Preview
I need to convert a date to a number that could be reconverted again in the original date, and -here's the point- I need to convert it to 0 if it's blank.
 

Varchar to Date SQL SERVER

Preview
Am a newbie to SQL server and finding it difficult to convert a varchar field to date (was easy in Access!)

I have a field in Table1 called Opened which gives a string dd/mm/y in varchar (10) format.

I wish to convert this to date and have tried various methods of which don't work. e.g.

ALTERTABLE dbo.Table1
ALTERCOLUMN OPENED date

I have also tried CONVERT CAST without success.
 

Converting a Text Date String to a Date for Calculations

Preview
I'm just jumping into Access and have the following question. In my Purchase Order Table, I have a date field calcualated as text, i.e. "01/12/04". I need to convert this to a date format in my queries so I can do calculations, i.e. 01/12/04 - 01/05/04 = 7 days. Can someone help me with how to convert this text date to a date format
 

numeric convert into text by using Access table

Preview
I just want to know how numeric convert into text by using Access table
 

Convert Number to a Date (Access 2007)

Preview
I have a CSV file that I import into an access database. The date field in the CSV file is in the format of 20100622 for 06/22/2010. How do I convert this field into a date field so that it will read as a date field? Once it is converted to a date, the field will need to be linked to another date in a different table. So the field types both have to be a date.