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 |
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-08-29 : 02:23:24
|
| i have a table tbl_datevcno and there is one column datevcno i want when a record is inserted in taht column than it should be in format that first the current date and then no of inserted value. if there is 5 insertion are made over there on date 29 aug 2012 thenvalues should be 29auh2012129aug2012229aug2012329aug2012429aug20125and next day on 30 aug 2012 when again 6 transaction aremade then the values should be 30auh2012130auh2012230auh2012330auh2012430auh2012530auh20126challenge everything |
|
|
shaggy
Posting Yak Master
248 Posts |
Posted - 2012-08-29 : 02:46:47
|
| try thisselect replace(convert(varchar(15),GETDATE(),106),' ','')+convert(varchar,ROW_NUMBER() over (order by object_id)) from sys.tables |
 |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-08-29 : 11:59:21
|
| not workschallenge everything |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-29 : 12:51:57
|
quote: Originally posted by pnpsql i have a table tbl_datevcno and there is one column datevcno i want when a record is inserted in taht column than it should be in format that first the current date and then no of inserted value. if there is 5 insertion are made over there on date 29 aug 2012 thenvalues should be 29auh2012129aug2012229aug2012329aug2012429aug20125and next day on 30 aug 2012 when again 6 transaction aremade then the values should be 30auh2012130auh2012230auh2012330auh2012430auh2012530auh20126challenge everything
is the month name change intentional from aug to auh or is it a typo?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-08-29 : 23:44:54
|
| it is augchallenge everything |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-30 : 01:25:23
|
| what does the last digit represent?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2012-08-30 : 06:44:53
|
| Why not use ACTUAL datetime values? Then you can see which was inserted first, etc.How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
|
|
|