Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-08-09 : 12:49:31
|
| How to write an equal statement where it has the following values:batch.descr = 'TIPF - ' + and the rest should be systems date. |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-09 : 12:53:09
|
you can use a CONVERT function.See if this works: batch.descr = 'TIPF - ' + Convert(Varchar,Getdate()) Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-08-09 : 12:56:45
|
| This did not work. Complains about invalid sql statement |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-09 : 12:58:54
|
| can you post the entire SQL statement you have?Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-08-09 : 13:01:27
|
| select batch.NUM from taxbus.batch where batch.DSCRN = "TIPF - " + GETDATE() |
 |
|
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-08-09 : 13:04:31
|
| aND DESCR IS A VARCHAR |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-09 : 13:09:06
|
| What is the exact error message?Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-08-09 : 13:40:09
|
| Invalid column name "TIPF - " maybe?Maybe you should try it the way dinakar suggested.CODO ERGO SUM |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-08-10 : 01:57:34
|
quote: Originally posted by baska123 select batch.NUM from taxbus.batch where batch.DSCRN = "TIPF - " + GETDATE()
You cant directly assign value returned from Getdate() to a string without convertionCan you post some sample data of batch.DSCRN column?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|