Don't use then date as an ident (it will be inefficient), use a date function with a date mask. Use the ident to seed the numbers at the end.
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -----Original Message----- From: Mo Afifi To: SQL Sent: Sun Feb 25 23:27:01 2007 Subject: Re: Identity Field > I am building a job recruitment application using ASP/VB and MS SQL > 2000. I would like use requisition number (REQ_ID) for each entry in > the database and I want that number to increment for each given day. > So the first REQ_ID for February 24, 2007 will be something like > (REQ-20070224-01) and the next REQ_ID will be (REQ-20070224-01). Can > this be done? My knowledge with computed columns is kind of limited. I know that I can do something like this:('REQ_ID-' + convert(varchar,[id_col])) where the [id_col] is a date in this format (YYYYMMDD). The part which I'm missing, actually two,is how to convert the date to this format (20070224) and how to increment the last 2 digits (i.e. 01, 02)? Any help is appreciated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2750 Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
