Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 19th, 2005, 09:45 PM
sam_sam sam_sam is offline
Contributing User
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2005
Posts: 1,377 sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 12 h 16 m 54 sec
Reputation Power: 10
help in query

Hi,

i have a table which is supposed to give customer_id to each person who joins on the internet

the customerid should be autogenerated each time
the customerid is in this fashion

05-01-18-001

(05 is the year,01 is the month,18 is the day)
the last three digits are auto incremented numbers

so if there are 5 members who join on the 18th january 2005 it will be

05-01-18-001
05-01-18-002
05-01-18-003
05-01-18-004
05-01-18-005

now a new member joins on the 19th january 2005 it will be

05-01-19-001
05-01-19-002
05-01-19-003
05-01-19-004
05-01-19-005
05-01-19-006
05-01-19-007


can someone tell me how to do this in sql

thanks,

sam

Reply With Quote
  #2  
Old January 20th, 2005, 12:49 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Don't crosspost.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > help in query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT