Results 1 to 2 of 2

Thread: Please Hepl Me!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Location
    VietNam
    Posts
    23

    Question Please Hepl Me!!

    Hi Guy!
    I'm the new fo ASP so Now I have The problem when I try to do My Code It allway to give me the message : " Type mismatch: 'Format' " I don't kwon why ! Please have me sovel the problem !
    This is my Code :
    SQL = "SELECT * FROM Orders Where OrderDate between '" & _
    Format(Request.Form("from"),"dd/mm/yyyy") & "' and '" & _
    Format(Request.Form("To"),"dd/mm/yyyy") & "'"
    Thanks alot.
    cuong

  2. #2
    Hyperactive Member Dinz's Avatar
    Join Date
    Jan 2002
    Posts
    359
    u cant do this in Asp unlike in VB Format(Request.Form("from"),"dd/mm/yyyy")...what I will suggest u is collect the varible from the form in mm/dd/yyyy pattern and then give the where condition........how I normally do in such circumstances for eg...........


    I take three select field in form viz Date,Month and Year.....user will select and submit the form , which I collect in this manner......

    temp=request.form("Month") & "/" & request.form("Day") & "/" & request.form("Year")

    ok now the date is in mm/dd/yyyy format and now u can easily run ur query like this.....


    SQL = "SELECT * FROM Orders Where OrderDate ='" & _
    '" & temp & "' "

Posting Permissions

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



Click Here to Expand Forum to Full Width