Related Topics

Convert Numeric Value to Date

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

Date Conversion
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
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
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
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.

Varchar to Date SQL SERVER
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.


I have also tried CONVERT CAST without success.

Converting date field in numbers
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.

Converting a Text Date String to a Date for Calculations
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
I just want to know how numeric convert into text by using Access table

Convert Number to a Date (Access 2007)
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.

Use Numeric Criteria in Expressions
To specify numeric criteria for an operation, you supply a numeric value as part of the string expression that forms the criteria argument. Learn how to specify numeric criteria for an operation.

Convert from text to UK Date ?
But took over a database that were created many years ago (upgraded from 2003), the Date of Birth are entered as text in the format of 01-Apr-1999

I try creating a new field in Data format but can't figure out how to convert using the content of the text field directly into the new Date format field (00/00/0000).

Some years ago when I were programming in Dataease, I would use the simple way for FirstC,MidC, LastC etc to convert them using the position and legnth of the string, but in Access, eventhough the principle should be the same...

Need to Convert "Text" Field to "Date" Field
We use a access database to manage ID cards. The old company (we fired) created a access database with dates as actual "text" instead of "date" fields.

Our new program uses access database but does not except the text string for a date. I need to convert the date as a text string to a date field. When I change the field in the table from text to date, it deletes all the entries. That is very bad as there are over 2,000 entries.

The format of the current text date string is 6 characters and displays as this: 020612

02 = Month
06 = Day
12 = Year

I need to convert this text to a date field with proper format of 02/02/2012. How do I do this in access without having to manually change every date before changing the field from "text" to "date" and erasing all current entries.

Query to convert String to Date??
Is it possible to convert a string version of a Date into an actual Date/Time format?

The source of my string version of the date can not have its formatted edited or changed.

The reason I need to do this conversion is so I can sort it. if the date is in string format, it will not sort like as if it was a date. Ex:

Instead of :

Linked tables from Access 2010 to SQL Server 2008
I have a table on SQL server with fields defined with the following data types:

Column Name | Data Type | PK/FK
id | numeric(38,0) | PK, FK
field1 | varchar(56)
field2 | numeric(38,0) | PK, FK
field3 | varchar(56)
field4 | date
field5 | date

After linking to this table from Access, when I select "Design view", all of the data types in Access show as Text

The source data in SQL server for column ID contains only numeric entries, as enforced by the data type.

In my Access Options, under Object Designers, for table design view my default field type is Text. I can understand VARCHAR being mapped to TEXT. However, based on the data mappings fromMicrosoft ([LINK]), NUMERIC should map to NUMBER.

Why is this happening? How can I correct it?

convert text to date
I'm begginer in access and I have the following problem:
In Acc Query I have field with Date/time type containing "16.1.2012 3. 21:00:00"
After separating date and time in two different fields (text type) I want to convert the date "Jan 16 2012", which is text into date/time type to link it to another table.

Tried DateValue(Format(CDate(left(all_bss_pmg_allbsspmg_ cell_bhr_kpi.timestamp,11)),"dd\.mm\.yyyy")) AS [Date]
and different other combinations of them but I get errors

Convert String to Date
I have the following string I need to convert to a date/time field via my Access query.

20110815 10:44:15

Convert Date Time

I'd like to query a table containing a date time column from an external client.
If I just select the column I get the wrong date time format.
In MS SQL is a function called Convert. Obviously this function is in Access not available. Now I search for a solution to format the date within the query

how to convert week number to date range
Is there any a simple way to convert week number to date range. For example, if I have the data=3, then I would like to convert it to 1/11/2009 to

How to convert dd/mm/yy to dd/mm/yyyy?
I have a form field asking to imput a date. At the moment I am forcing the user to input date as dd/mm/yyyy via inputmask. But is there a code I can use so that even if the user type in dd/mm/yy in the box, on update it will convert this to dd/mm/yyyy format