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 |
|
shanmugaraj
Posting Yak Master
219 Posts |
Posted - 2006-03-30 : 02:10:39
|
| how to insert current year into table,I tried , insert into tablename values('','',year)i also need to know how to insert month , day |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-03-30 : 02:40:10
|
to get current year use the getdate(). Getdate() will return the current date & timeselect year(getdate())select month(getdate())select day(getdate()) KHChoice is an illusion, created between those with power, and those without.Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-30 : 02:58:26
|
| orselect datepart(year,getdate())Also, why do you want to store day, month and year in seperate columns?Use Datetime datatype to store dates and use format function in Front End application to format it to the way you wantMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|