| Author |
Topic |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2006-06-05 : 05:01:18
|
| how can I select all records where the date is within the last half hour.select * from users where dateentered<getdate()-???Alsowithin a stored procedure can I do somehting like thisif mysting like 'testing%' then /*do nothing */else select @ok=1Is that valid to do? |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-06-05 : 05:07:24
|
> dateadd(n, -30, getdate())Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"] |
 |
|
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
Posted - 2006-06-05 : 05:50:51
|
quote: Alsowithin a stored procedure can I do somehting like thisif mysting like 'testing%' then /*do nothing */elseselect @ok=1
Yes!...declare @mystring varchar(20), @ok bitset @mystring = 'not testing'if not @mystring like 'testing%' set @ok = 1select @ok Ryan Randallwww.monsoonmalabar.com London-based IT consultancy Solutions are easy. Understanding the problem, now, that's the hard part. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-05 : 07:10:34
|
quote: Originally posted by spirit1 > dateadd(n, -30, getdate())Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"]
Just for clarity, I prefer usingdateadd(minute, -30, getdate())MadhivananFailing to plan is Planning to fail |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-06-05 : 08:31:39
|
i prefer less typing Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"] |
 |
|
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
Posted - 2006-06-05 : 09:00:40
|
And I do not prefer one over the other Ryan Randallwww.monsoonmalabar.com London-based IT consultancy Solutions are easy. Understanding the problem, now, that's the hard part. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-05 : 09:04:53
|
quote: Originally posted by RyanRandall And I do not prefer one over the other Ryan Randallwww.monsoonmalabar.com London-based IT consultancy Solutions are easy. Understanding the problem, now, that's the hard part.
So, what do you prefer? MadhivananFailing to plan is Planning to fail |
 |
|
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
Posted - 2006-06-05 : 09:15:09
|
I prefer to sit on the fence Ryan Randallwww.monsoonmalabar.com London-based IT consultancy Solutions are easy. Understanding the problem, now, that's the hard part. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-06-05 : 09:21:53
|
For me, I will go for Madhivanan's method.  KH |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-06-05 : 09:24:40
|
i'll go with ryan's i like his... Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"] |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-06 : 01:57:09
|
i like sitting on a fence, and on top of my table, and on top of my car, and on the 2nd deck of a bus... --------------------keeping it simple... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-06 : 04:35:45
|
quote: Originally posted by jen i like sitting on a fence, and on top of my table, and on top of my car, and on the 2nd deck of a bus... --------------------keeping it simple...
Where are you now Jen? Homeland or Singapore MadhivananFailing to plan is Planning to fail |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-06 : 04:48:16
|
still in the land of the durian ampitheater how about you Maddy, are you in India or somewhere else?--------------------keeping it simple... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-06 : 05:05:55
|
in India MadhivananFailing to plan is Planning to fail |
 |
|
|
|