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 |
|
abuhassan
105 Posts |
Posted - 2006-06-15 : 09:40:37
|
| hi i wanted to crete an extra colunm when i retrive a set of rows... the date colunm must show the current date eg 15/06/2006currently im writing it as followsselect cost, '15/06/2006' as CDatefrom pricesas you can see this is static date i need the date to be current whenever the query is done. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-15 : 09:46:10
|
| Why do you want to do this?Can you give us more details?MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-06-15 : 10:42:58
|
[code]select cost, '15/06/2006' getdate() as CDatefrom prices[/code]Perform the formating of CDate to the format you want in your front end application KH |
 |
|
|
abuhassan
105 Posts |
Posted - 2006-06-15 : 10:49:41
|
| The reason is for auditing the changes i cannot use a time stamp or any thing else because that is the format required for the date.basically when the data is collected and exported from the view it should provide the date of the data export. since the other applicaton requires the data in that format and for auditing it is used to check the date.. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-06-15 : 10:54:50
|
quote: Originally posted by abuhassan The reason is for auditing the changes i cannot use a time stamp or any thing else because that is the format required for the date.basically when the data is collected and exported from the view it should provide the date of the data export. since the other applicaton requires the data in that format and for auditing it is used to check the date..
Then use convert to format itselect cost, convert(varchar(10), getdate(), 103) as CDatefrom prices KH |
 |
|
|
|
|
|