Click here to Skip to main content
15,887,746 members
Home / Discussions / Database
   

Database

 
GeneralRe: select upcoming birthday? Pin
Meax11-Mar-09 23:27
Meax11-Mar-09 23:27 
GeneralRe: select upcoming birthday? Pin
Jay Royall11-Mar-09 23:41
Jay Royall11-Mar-09 23:41 
AnswerRe: select upcoming birthday? Pin
je_gonzalez15-Mar-09 16:07
je_gonzalez15-Mar-09 16:07 
QuestionCreate Table in Oracle 10G Pin
E_Gold11-Mar-09 2:47
E_Gold11-Mar-09 2:47 
AnswerRe: Create Table in Oracle 10G Pin
Blue_Boy11-Mar-09 2:57
Blue_Boy11-Mar-09 2:57 
GeneralRe: Create Table in Oracle 10G Pin
E_Gold11-Mar-09 5:36
E_Gold11-Mar-09 5:36 
QuestionGenerate Reference Number Pin
musefan11-Mar-09 0:06
musefan11-Mar-09 0:06 
AnswerRe: Generate Reference Number Pin
Blue_Boy11-Mar-09 2:18
Blue_Boy11-Mar-09 2:18 
Hope this will help you

string refnum = "091222REF";//here you get last reference number from database<br />
            string newrefNum = "";<br />
            if (DateTime.Now.ToString("yy") != refnum.Substring(0, 2))<br />
            {<br />
                newrefNum = DateTime.Now.ToString("yy") + "0001REF";<br />
            }<br />
            else<br />
            {<br />
                int incNum = int.Parse(refnum.Substring(2, 4)) + 1;<br />
<br />
                newrefNum = DateTime.Now.ToString("yy") +  incNum.ToString("0000") + "REF";<br />
            }



I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.


GeneralRe: Generate Reference Number Pin
musefan11-Mar-09 2:29
musefan11-Mar-09 2:29 
GeneralRe: Generate Reference Number Pin
Blue_Boy11-Mar-09 2:55
Blue_Boy11-Mar-09 2:55 
QuestionT-SQL and XML question. Pin
Jamie Nordmeyer10-Mar-09 17:11
Jamie Nordmeyer10-Mar-09 17:11 
QuestionRandom or sequential allocation! Pin
Learner52010-Mar-09 14:06
Learner52010-Mar-09 14:06 
AnswerRe: Random or sequential allocation! Pin
Ashfield10-Mar-09 22:04
Ashfield10-Mar-09 22:04 
QuestionRandom or sequential allocation Pin
Learner52010-Mar-09 6:52
Learner52010-Mar-09 6:52 
AnswerRe: Random or sequential allocation Pin
Blue_Boy10-Mar-09 13:32
Blue_Boy10-Mar-09 13:32 
Question@@Identity and triggers Pin
Distind10-Mar-09 3:51
Distind10-Mar-09 3:51 
AnswerRe: @@Identity and triggers Pin
Mycroft Holmes10-Mar-09 16:35
professionalMycroft Holmes10-Mar-09 16:35 
QuestionCannot connect to SQL express database on XP Home edition under a new admin login Pin
Shrikant Gujar9-Mar-09 23:11
Shrikant Gujar9-Mar-09 23:11 
QuestionComposite Primary Key Pin
Jay Royall9-Mar-09 22:02
Jay Royall9-Mar-09 22:02 
AnswerRe: Composite Primary Key Pin
Rob Philpott9-Mar-09 23:21
Rob Philpott9-Mar-09 23:21 
GeneralRe: Composite Primary Key Pin
Jay Royall9-Mar-09 23:36
Jay Royall9-Mar-09 23:36 
AnswerRe: Composite Primary Key Pin
Curtis Schlak.10-Mar-09 13:29
Curtis Schlak.10-Mar-09 13:29 
AnswerRe: Composite Primary Key Pin
Mycroft Holmes10-Mar-09 16:43
professionalMycroft Holmes10-Mar-09 16:43 
Questionhow to generate ID field with auto numbering Pin
sharp_k9-Mar-09 12:44
sharp_k9-Mar-09 12:44 
AnswerRe: how to generate ID field with auto numbering Pin
Luc Pattyn9-Mar-09 13:15
sitebuilderLuc Pattyn9-Mar-09 13:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.