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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 cdate() equavalent in SQL

Author  Topic 

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2009-10-05 : 12:19:21
Dear All,
I am converting Cognos Queries into SQL Query.Can anybody tell me the equvalent SQL query for below Cognos query.

select date= (CDATE(T1."SERVICE_DATE_IH")) from T1

Thanks,
Gangadhar

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2009-10-05 : 12:29:11
Dear All,

Also this part of the Query

Select xyz=((YMDINT_EXTRACT(DATETIME_TO_YMDINT((CDATETIME(LASTDAY(CDATE(T1."INVOICE_CREATE_PERIOD_DT_IH"))))),4))) from T1


pls help me in this regard.

Thanks,
Gangadhar
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-10-05 : 12:29:29
is cdate a vb function?


Like

http://msdn.microsoft.com/en-us/library/2dt118h2%28VS.85%29.aspx

???

Do you only want the Date portion of datetime data?

SELECT CONVERT(varchar(10), GetDate(), 101)



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2009-10-05 : 12:31:08
Cdate() actually a Cognos Function. The query is generated by Cognos i am migrating it to SQL.

Pls help
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-10-05 : 12:34:37
quote:
Originally posted by gangadhara.ms

Cdate() actually a Cognos Function. The query is generated by Cognos i am migrating it to SQL.

Pls help



OK, so what does cdate() do??????

I added more to my post above



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2009-10-05 : 12:40:37
I am not sure with Cdate() function in Cognos ? :(
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-10-05 : 14:25:52
well if you don't know what it does...how can we possibly help you?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-05 : 14:28:54
cdate() in vb converts the expression to date format. so i think equivalent sql statement should be convert(datetime,...) or cast(... as datetime)
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-10-05 : 14:48:24
quote:
Originally posted by visakh16

cdate() in vb converts the expression to date format. so i think equivalent sql statement should be convert(datetime,...) or cast(... as datetime)



Kinda like post #3?




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -