Results 1 to 4 of 4

Thread: Dates

  1. #1
    pmorales Guest

    Default Dates

    I have an asp form and I am using a SQL server. How can I control the way that users enter a date on my form. I want it to be consistent everytime. Would this be somenting done in asp or sql? Please let me know.

  2. #2
    Join Date
    Dec 1969

    Default RE: Dates

    do it in asp<BR><BR>i can think of a couple ways to do it (you&#039;re the one who has to code, so pick the way that best fits your situation)<BR><BR>method 1<BR>--------<BR>make dropdowns for day, month, and year then use string manipulation to format the values chosen before putting them into the db<BR><BR>method 2<BR>--------<BR>have a single textbox for inputing the date and just do some server-side validation of the value entered when the user submits (or use javascript to do it on the onBlur event - when the user takes focus off of the textbox)<BR><BR>if this doesn&#039;t make sense, please say so

  3. #3
    pmorales Guest

    Default RE: Dates

    yeah this sounds good. Thanks for your help!

  4. #4
    ChizWheez Guest

    Default RE: Dates

    Don&#039;t know much about SQL server, but when I want to get new dates (no pun intended) in a specific format, I use &#060;select&#062;:<BR><BR>Month: &#060;select name="month"&#062;<BR> &#060;option value="01"&#062;January&#060;/option&#062;<BR> &#060;option value="02"&#062;February&#060;/option&#062;<BR>...etc...<BR><BR>then you just build the date from that in your ASP code on the next page:<BR><BR>The_Date = request.Form("month") & "/" & request.form("day") & "/" & request.form("year")<BR><BR>

Posting Permissions

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