About
Pricing
Community
Teams
Start Free Trial
Log in
GAUTAM
asked on
3/12/2012
Sybase command doubt
Hi Experts...
I have a sybase quesry as shown which gives the resultant as :315.
Can anyone explain how this result is achieved.
Query:
select ( ((datepart(hh,'5:28:31') * 60) + datepart(mi,'5:28:31'))/15
)*15
Result:
315
Please help...
Sybase Database
Databases
4
2
Last Comment
Sharon Seth
8/22/2022 - Mon
Sharon Seth
3/12/2012
datepart(hh,'5:28:31') returns the hour part i.e 5
datepart(mi,'5:28:31') returns the minute part , which is 28
hh and mi are predefined constants in sybase
SOLUTION
Jan Franek
3/12/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
GAUTAM
3/12/2012
ASKER
@sharonseth:Thanks for the reply.
Is select(datepart(mi,'5:28:3
1'))/15)*1
5 where the resultant i s1.8666 is it rounded off to 1 so the resultant is 300+15.
Please clarify.
ASKER CERTIFIED SOLUTION
Sharon Seth
3/12/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
datepart(mi,'5:28:31') returns the minute part , which is 28
hh and mi are predefined constants in sybase