473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Convert INT YYYYMMDD to date mm/dd/yyyy

I can't seem to find a way to convert an INT type in the form of YYYYMMDD to
an actual date form of mm/dd/yyyy

Can anyone pointt me in the right direction?

Thanks
Aug 23 '07 #1
1 72923
Hi there,

The easiest way to achieve your goal is to convert your INT into an
eight character long string first, and then convert your string in the
datetime format.
As an example : SELECT CONVERT(DATETIME, CONVERT(CHAR(8), 20070824))

Elsewhere, it is a bit complicated, as the DateTime format is based on
the difference in days from 1900/01/01. Thus, you have to use a quite
heavy function as leap years are not regular. All the functions I
tried have bad performance compared to the double conversion.

Enjoy,

Cédric Del Nibbio
MCT
MCDBA SQL Server 2000
MCITP Database Administrator SQL Server 2005
MCSD .NET
http://cedric-delnibbio-sql.blogspot.com

On 24 août, 00:41, "rdraider" <rdrai...@sbcglobal.netwrote:
I can't seem to find a way to convert an INT type in the form of YYYYMMDDto
an actual date form of mm/dd/yyyy

Can anyone pointt me in the right direction?

Thanks
Aug 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
1
by: ABC | last post by:
How to convert a date string to datetime value with custom date format? e.g. Date String Date Format Result (DateTime value) "05/07/2004" "MM/dd/yyyy" May 7, 2004 "01062005" ...
1
by: Sam | last post by:
How do I convert Julian Date to Calendar Date in ASP.Net 1.1 based on following guideline found at Internet? To convert Julian date to Gregorian date: double JD = 2299160.5; double Z =...
4
by: Daniel Kaseman | last post by:
How do I convert a date into a serial number? (I'm trying to enter a FROM date and a TO date, then make my PROGRESS BAR show how close I am to the TO date.) get it? I know that MS Excel...
2
by: Kakishev | last post by:
I have a problem at how best to convert a Date into a text field and keep the format dd/mmm/yyyy (01-FEB-2007). The problem is that dates are imported from SQL into an access front end Database....
3
by: lyne_asp | last post by:
Please help me to convert excel date to asp date. Here is my code objConnEx.open "Provider=Microsoft.Jet.OLEDB.4.0;Data...
4
by: Ashraf Ansari | last post by:
Hi, How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date which is converted into dd/MM/yyyy should be in DateTime format. I do not want to store it as a string. Please help ...
3
by: maminx | last post by:
Hello all, asking again i want to convert format date from "YYYY-mm-dd" to "dd-mm-YYYY" example from "2008-08-16" become format date like this one "16-08-2008" is it anyone who has this...
4
by: Lagon666 | last post by:
Is any solution to convert "1055901520" to yyyy/mm/dd: $date = getdate(); print $date; // return 1055901520
1
by: smdmca | last post by:
I have Julian date, I want to convert it into date. Is there any function in MySql to convert Julian date to date eg- Julian Date- 2455116 Date - Oct - 12, 2009
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.