Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Have a field in a table that contains JDEdwards Julian date data that is in the format CYYDDD. How can I convert this column of data into something like mm/dd/yyyy?Are there any date conversion routines?
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-05-05 : 12:35:26
see this example
DECLARE @JulDate intSET @JulDate=107263SELECT CONVERT(varchar(11),DATEADD(dd,(@JulDate%1000)-1,DATEADD(yy,(@JulDate/1000),0)),101) AS dateval
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
pgmr1998
Yak Posting Veteran
66 Posts
Posted - 2012-05-05 : 13:15:36
I get an error that saysToken @JULDATE was not valid
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-05-05 : 13:42:21
quote:Originally posted by pgmr1998 I get an error that saysToken @JULDATE was not valid
show the full query if its different from what i postedposted query is tested and is working for me------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-05-05 : 13:43:15
Token @JULDATE was not validAre you using MS SQL Server. Doesnt look like a t-sql error message from aboveAre you using different editor?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
pgmr1998
Yak Posting Veteran
66 Posts
Posted - 2012-05-05 : 13:47:44
Im on an IBM AS400 iSeries
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-05-05 : 14:10:48
quote:Originally posted by pgmr1998 Im on an IBM AS400 iSeries
then you're in wrong forumThis is MS SQL Server forumPlease post in reelevant forum for getting specific syntax help------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/