Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Posts
    2

    Unanswered: Database design question

    I am brand new to both programming and databases and am trying to design a database for my job as a paramedic.

    I am using Visual Studio 2005 , and MSSQL . I am trying to create a log for all of our ambulance calls.

    My question comes in when I try to design a field that holds our case number , which is formatted as 07-0001. Basically, the year , then four digits for the remainder of the case number .

    Any help on how to accomplish this would be SO appreciated !!!

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    I would use a varchar for this.

    presumably you want to preserve the minus sign and the leading zero - this rules out any numeric storage types such as int.

  3. #3
    Join Date
    Mar 2007
    Posts
    2

    Database design question...

    Thanks ! So, does this mean I can't use that field as an ID for my database ? Also, how would I go about the formatting I would need ?

    Sorry to be such a novice, but I do SO appreciate the help !

  4. #4
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    the reply depends on many other questions. will the database generate the next call-number or it is a user input/front-end generated number? is the number editable? will the number recycle missing numbers specially the last deleted ones?
    there are quite a few options. it could be saved in 2 separate fileds and formatted properly during display, it could be a formula field, it could be a plain varchar field with validations etc. etc...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •