How do we concatenate strings using ASP ?

Results 1 to 4 of 4

Thread: How do we concatenate strings using ASP ?

  1. #1
    Join Date
    Dec 1969
    Posts
    30

    Default How do we concatenate strings using ASP ?

    I have a &#039birthdate&#039 field in my form. It consists of three text boxes namely month, year and date. I want to save all this under a single column called&#039Birthdate&#039 in my database table. Is that possible? if so then how?

  2. #2
    ian Stallings Guest

    Default RE: How do we concatenate strings using ASP ?

    You can do this using something like this:<BR><BR>varMonth = request.Form("Month")<BR>varDate = request.Form("Date")<BR>varYear = request.Form("Year")<BR><BR>Birthdate = varMonth & "/" & varDate & "/" & varYear<BR><BR>and then you would use "Birthdate" as the data to be inserted in<BR>your SQL statement. You can change the format as needed.<BR>Instead of using "/" to seperate values you can use "-"<BR>or nothing at all.<BR><BR>hope this helps.

  3. #3
    Join Date
    Dec 1969
    Posts
    30

    Default RE: How do we concatenate strings using ASP ?

    Thanks Ian,<BR><BR>Your trick worked, but then I ahve another problem. When I retrieve my birthdate from the database, it get a mm/dd/yy format under a single column. How can I store month, year and date in 3 separate variables fromthis format? <BR>Help me out!

  4. #4
    Scott Cate Guest

    Default RE: How do we concatenate strings using ASP ?

    If your always wanting the birthday fields separated why do you store them in seperate fields and then build the BIRTHDAY as needed.<BR><BR>This seems like a lot less code.


Posting Permissions

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