Data Type:Date/Time

Results 1 to 2 of 2

Thread: Data Type:Date/Time

  1. #1
    Young Guest

    Default Data Type:Date/Time

    Hi, I need help from you! <BR>I am getting data from Access database. I am running a query on my asp page like:<BR><BR>If Request.Form("passDate") &#060;&#062; "" Then<BR> strIT = Request.Form("passDate")<BR> strSQL1 = ""<BR> strSQL1 = "SELECT RefreshID from WuRefresh Where Date = &#039" & strIT & "&#039"<BR>End If<BR><BR>Set objRec = Server.CreateObject ("ADODB.Recordset")<BR>&#039Response.Write strSQL1<BR>objRec.Open strSQL1, strConnect, adOpenForwardOnly, adLockReadOnly, adCmdText<BR>Response.Write RecToTableForDefault (objRec)<BR>objRec.Close<BR>Set objRec = Nothing<BR><BR>My data type for date in Access is Date/time. But it yells at me in the line of opening the recordset(objRec.Open strSQL1, strConnect, adOpenForwardOnly, adLockReadOnly, adCmdText<BR>). So I changed the field to Text instead of using Date/Time. Now it&#039s opening the recordset and I can get the data from the database. Is there any way that I can still use Date/Time as data type and yet getting the data with no problem?<BR><BR>Note:<BR>When I get my SQL statement, it says:<BR>Select RefreshID from WuRefresh Where Date = &#039 12/1/1999&#039<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Data Type:Date/Time

    You should be able to change it back to Date/Time and then just "wrap" the variable with #&#039s.<BR><BR>e.g. = #" & strIT & "#"<BR><BR>HTH<BR><BR>Jerry

Posting Permissions

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