SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SELECT TOP query falls over
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rasta Pickles
Posting Yak Master

United Kingdom
171 Posts

Posted - 03/18/2013 :  09:23:22  Show Profile  Reply with Quote

SELECT 'I', top 1
ActivityDate  + cast(ActivityTime as datetime)
from FinancialActivity
order by ActivityDate desc, ActivityTime desc


fails with invalid syntax?

How do I get output of I 18/03/2013 (not 18/03/2013 I)?

Thanks in advance.

bandi
Flowing Fount of Yak Knowledge

India
2206 Posts

Posted - 03/18/2013 :  10:01:04  Show Profile  Reply with Quote
SELECT top 1 'I',
ActivityDate + cast(ActivityTime as datetime)
from FinancialActivity
order by ActivityDate desc, ActivityTime desc





--
Chandu
Go to Top of Page

Rasta Pickles
Posting Yak Master

United Kingdom
171 Posts

Posted - 03/18/2013 :  10:09:33  Show Profile  Reply with Quote
Many thanks, ridiculously easy when you know how!
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2206 Posts

Posted - 03/18/2013 :  10:15:35  Show Profile  Reply with Quote
quote:
Originally posted by Rasta Pickles

Many thanks, ridiculously easy when you know how!


Any way... you sorted out...
Welcome

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000