dbTalk Databases Forums  

Trying to pull data in SQL from a Platinum Database. Have date issues.

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Trying to pull data in SQL from a Platinum Database. Have date issues. in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sam
 
Posts: n/a

Default Trying to pull data in SQL from a Platinum Database. Have date issues. - 07-13-2005 , 01:00 PM






The date in SQL shows up
as 729089
Even in Excel the grid shows for eg. the data as 3/29/3896 when I format
the date as a Date.

I was provided the following information but I am not sure how to change the
date to show correctly.

-------------------

Platinum SQL Version 4.2

Date solution:


'The next two constants are the same date in SQL and Platinum formats.

Global Const gstrPLAT_EQUATE_DATE = "'1/1/98'"

Global Const glngPLAT_EQUATE_DATE = 729390

'The SQL expression
DATEDIFF(dd,gstrPLAT_EQUATE_DATE,sqldate)+glngPLAT _EQUATE_DATE

' converts a SQL date to the equivalent Platinum date.

'The SQL expression
DATEADD(dd,platdate-glngPLAT_EQUATE_DATE,gstrPLAT_EQUATE_DATE)

' converts a Platinum date to the equivalent SQL date





Thank you very much for your assistnace.


S Commar

s_commar (AT) hotmail (DOT) com



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Trying to pull data in SQL from a Platinum Database. Have date issues. - 07-13-2005 , 01:05 PM






Ok So it looks as though platinum has an offset date. This is hours past
1/1/1900 00:00:00.

DateAdd() will allow you to translate this to a date.

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Sam" <s_commar (AT) hotmail (DOT) com> wrote

Quote:
The date in SQL shows up
as 729089
Even in Excel the grid shows for eg. the data as 3/29/3896 when I format
the date as a Date.

I was provided the following information but I am not sure how to change
the date to show correctly.

-------------------

Platinum SQL Version 4.2

Date solution:


'The next two constants are the same date in SQL and Platinum formats.

Global Const gstrPLAT_EQUATE_DATE = "'1/1/98'"

Global Const glngPLAT_EQUATE_DATE = 729390

'The SQL expression
DATEDIFF(dd,gstrPLAT_EQUATE_DATE,sqldate)+glngPLAT _EQUATE_DATE

' converts a SQL date to the equivalent Platinum date.

'The SQL expression
DATEADD(dd,platdate-glngPLAT_EQUATE_DATE,gstrPLAT_EQUATE_DATE)

' converts a Platinum date to the equivalent SQL date





Thank you very much for your assistnace.


S Commar

s_commar (AT) hotmail (DOT) com





Reply With Quote
  #3  
Old   
Sandeep Commar
 
Posts: n/a

Default Re: Trying to pull data in SQL from a Platinum Database. Have date issues. - 07-13-2005 , 01:10 PM



Thanks for your assistance.

So can I do an update statement. Could you please advise as I am not
sure what I have to do exactly to sort this out.

Thank you for your assistance.

S Commar



*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Trying to pull data in SQL from a Platinum Database. Have date issues. - 07-13-2005 , 02:03 PM



You can do an UPDATE but this will be different. You can either

1. Use a Data Driven Query Task
2. Use a Linked Server
3. Transfer the rows locally and do the update.



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Sandeep Commar" <s_commar (AT) hotmail (DOT) com> wrote

Quote:
Thanks for your assistance.

So can I do an update statement. Could you please advise as I am not
sure what I have to do exactly to sort this out.

Thank you for your assistance.

S Commar



*** Sent via Developersdex http://www.developersdex.com ***



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.