Author |
Topic |
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-07-21 : 07:27:21
|
SELECT top 1 SUM(CALL_DURATION/60) AS nat_ROAM_talktime,CONVERT(VARCHAR(8),CALL_DATE,20) as date FROM CDRWHERE roam_flag =1GROUP BY CONVERT(VARCHAR(8),CALL_DATE,20)order by CONVERT(VARCHAR(8),CALL_DATE,20) int his queriry i am getting top 1 but i need bottom one please send a quiery |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-21 : 07:28:25
|
order by . . DESC KH[spoiler]Time is always against us[/spoiler] |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-21 : 07:34:39
|
Don't convert the date to string. If the call_date contains time, just remove it using belowSELECT TOP 1 SUM(CALL_DURATION/60) AS nat_ROAM_talktime, DATEADD(DAY, DATEDIFF(DAY, 0, CALL_DATE), 0) AS [date]FROM CDRWHERE roam_flag = 1GROUP BY DATEADD(DAY, DATEDIFF(DAY, 0, CALL_DATE), 0)ORDER BY [date] DESC KH[spoiler]Time is always against us[/spoiler] |
 |
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-07-21 : 07:55:42
|
date add function requires 3 arguments |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-21 : 07:57:38
|
sorry typo. Amended. KH[spoiler]Time is always against us[/spoiler] |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-21 : 11:29:21
|
"Please very adjent"What is adjent? |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-21 : 11:31:33
|
quote: Originally posted by sodeep "Please very adjent"What is adjent?
thats another typo...he meant urgent i guess |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-22 : 04:04:14
|
quote: Originally posted by visakh16
quote: Originally posted by sodeep "Please very adjent"What is adjent?
thats another typo...he meant urgent i guess 
Yes it is. Thats why the spelling mistake MadhivananFailing to plan is Planning to fail |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-07-22 : 04:55:09
|
Why are problems always very urgent, not 'slightly important' or 'fairly critical', or 'can wait til next week'?--Gail ShawSQL Server MVP |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-22 : 04:59:13
|
Lack of competence? E 12°55'05.25"N 56°04'39.16" |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-07-22 : 05:08:51
|
Laziness?--Gail ShawSQL Server MVP |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-07-22 : 05:12:55
|
these kinds of posts are seriously starting to irritate me. and i don't get irritated easily especially the one whit "urgenttttttttttttt" _______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-07-22 : 05:22:32
|
how'd you guess? _______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-07-22 : 05:41:00
|
quote: Originally posted by spirit1 these kinds of posts are seriously starting to irritate me. and i don't get irritated easily 
Yup. I'm starting to ignore the pleas of urgency."When everything's urgent, nothing's urgent"--Gail ShawSQL Server MVP |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-22 : 10:17:17
|
I have seen this guy(Ramu) always put "Urgent" or Adjent in his request. |
 |
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2008-07-22 : 10:41:32
|
My guess is some of these people wait until the deadline nears on a project and due to ineptness, they haven't completed their code. Then it's mission critical and they turn to these sites so that some of you (being the kind-hearted talents that you are) will help save their butts and their jobs - then it's VERY ADJENT. I've seen the code you all turn out and it's amazing. It's what I strive to be able to do as I continue to learn but at least I, and many others, make an honest attempt to do it myself, turning for help when I've simply become too frustrated to spot the obvious. I can say you've never disappointed me in your responses. Your patience with some of these posters is incredible - somehow I think you should all have "saint" somewhere within your titles, not only Peso but everyone else who has posted on this topic (except, of course Ramu). I do have to admit though, some of them are just too funny (or sad, depending on your outlook).Terry |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-23 : 11:33:34
|
Your gain is probably that you study and learn the suggestion we make.Ramu and his peers will never study them and learn. E 12°55'05.25"N 56°04'39.16" |
 |
|
|