| Author |
Topic |
|
gemini_shooter
Starting Member
12 Posts |
Posted - 2008-11-17 : 16:27:55
|
| Hello,I am trying to remove the timestamp from the today function, unfortuantely have been unable to find a function which just returns the date without the timestamp.Can you please guide me in a direction.Thanksgemini_shooter |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-11-17 : 16:57:29
|
| [code]select [current_timestamp] = current_timestamp, [current_date] = dateadd(dd,datediff(dd,0,current_timestamp),0)Results:current_timestamp current_date----------------------- -----------------------2008-11-17 16:56:59.403 2008-11-17 00:00:00.000(1 row(s) affected)[/code]CODO ERGO SUM |
 |
|
|
gemini_shooter
Starting Member
12 Posts |
Posted - 2008-11-17 : 17:17:55
|
| Thanks Michael, is there way I can do it in expressions and not TSQL |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-18 : 04:54:29
|
quote: Originally posted by gemini_shooter Thanks Michael, is there way I can do it in expressions and not TSQL
What do you mean by expressions?MadhivananFailing to plan is Planning to fail |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-11-18 : 05:18:41
|
| If by expression you mean function, I don't think there is. |
 |
|
|
gemini_shooter
Starting Member
12 Posts |
Posted - 2008-11-18 : 21:25:15
|
| I feel so stupid but it was just a matter of formating date timestamp into a 'd' to remove the timestamp.Thanks a lot guys ... |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-11-19 : 01:30:24
|
| You can use this query also...in place of 105, you can use several numbers like 101,102......upto 121select convert(varchar(25),getdate(),105)select convert(varchar(12),getdate(),113)ArnavEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-19 : 02:14:40
|
quote: Originally posted by sunsanvin You can use this query also...in place of 105, you can use several numbers like 101,102......upto 121select convert(varchar(25),getdate(),105)select convert(varchar(12),getdate(),113)ArnavEven you learn 1%, Learn it with 100% confidence.
Nope. dont change datatype just for presenation formatting. its simply a matter of handling this at front end application where you have functions avaialable for this |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-20 : 01:27:38
|
quote: Originally posted by sunsanvin in place of 105, you can use several numbers like 101,102......upto 121ArnavEven you learn 1%, Learn it with 100% confidence.
Not TrueMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-20 : 01:32:29
|
| see this for available valueshttp://msdn.microsoft.com/en-us/library/ms187928(SQL.90).aspx |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-11-20 : 01:53:44
|
quote: Originally posted by madhivanan
quote: Originally posted by sunsanvin in place of 105, you can use several numbers like 101,102......upto 121ArnavEven you learn 1%, Learn it with 100% confidence.
Not TrueMadhivananMadhi, can you please correct me here.....i've tested for different values.... and working fine for meFailing to plan is Planning to fail
ArnavEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-11-20 : 02:15:50
|
| Simply Superb...thanks for the clarification peso....ArnavEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-20 : 04:00:10
|
quote: Originally posted by sunsanvin
quote: Originally posted by madhivanan
quote: Originally posted by sunsanvin in place of 105, you can use several numbers like 101,102......upto 121ArnavEven you learn 1%, Learn it with 100% confidence.
Not TrueMadhivananMadhi, can you please correct me here.....i've tested for different values.... and working fine for meFailing to plan is Planning to fail
ArnavEven you learn 1%, Learn it with 100% confidence.
select convert(varchar(25),getdate(),115)select convert(varchar(25),getdate(),116)select convert(varchar(25),getdate(),117)etcMadhivananFailing to plan is Planning to fail |
 |
|
|
|