Date question

I am working on an ASP web page right now. I'm trying to insert and update a field in my database that is a "DATE/TIME" field.

I have created a form that will capture the date. Then that information gets passed to the next page, which I have created an insert query or an update query.

I'm having trouble formatting the date so that I can insert or update the record.

Here is how I have formated it.

Activity_Date=#::Act_Date::#

When I do that it gives me the following error

Database Results Wizard Error
Unable to find operator in query string. Query string currently is UPDATE Activities SET Activity_Date=#::Act_Date::# WHERE Activity_ID=Act_ID;

So I'm not sure how to format it so that it will put the date in. I have tried the "&", but that doesn't work either.

Please help.
Terry

Comments

  • : I am working on an ASP web page right now. I'm trying to insert and update a field in my database that is a "DATE/TIME" field.
    :
    : I have created a form that will capture the date. Then that information gets passed to the next page, which I have created an insert query or an update query.
    :
    : I'm having trouble formatting the date so that I can insert or update the record.
    :
    : Here is how I have formated it.
    :
    : Activity_Date=#::Act_Date::#
    :
    : When I do that it gives me the following error
    :
    : Database Results Wizard Error
    : Unable to find operator in query string. Query string currently is UPDATE Activities SET Activity_Date=#::Act_Date::# WHERE Activity_ID=Act_ID;
    :
    : So I'm not sure how to format it so that it will put the date in. I have tried the "&", but that doesn't work either.
    :
    : Please help.
    : Terry
    :


    I dont understand this line:
    Activity_Date=#::Act_Date::#

    Lets assune that you are getting the date in the next page like this:
    [code]
    Activity_date=Request("Activity_date")
    [/code]

    Now the sql will be:

    [code]
    strSql="UPDATE Activities SET Activity_Date=#"&Activity_Date&"# WHERE Activity_ID="&Act_ID;
    [/code]

    If that doesnt work,show your code.


  • [b][red]This message was edited by harddrive747 at 2004-11-23 19:22:45[/red][/b][hr]
    Thanks. I will try this when I get home later.

    The #::Act_Date::" is the way that I get the information from the previous page. I'm working with FrontPage 2003 and I have done it that way for other fields and it has worked great. Just the date field and the time fields are my problem right now.

    So basically the form is on one page and then I send it to the confirmation page, which has the update query in it.

    Thanks
    Terry

    : : I am working on an ASP web page right now. I'm trying to insert and update a field in my database that is a "DATE/TIME" field.
    : :
    : : I have created a form that will capture the date. Then that information gets passed to the next page, which I have created an insert query or an update query.
    : :
    : : I'm having trouble formatting the date so that I can insert or update the record.
    : :
    : : Here is how I have formated it.
    : :
    : : Activity_Date=#::Act_Date::#
    : :
    : : When I do that it gives me the following error
    : :
    : : Database Results Wizard Error
    : : Unable to find operator in query string. Query string currently is UPDATE Activities SET Activity_Date=#::Act_Date::# WHERE Activity_ID=Act_ID;
    : :
    : : So I'm not sure how to format it so that it will put the date in. I have tried the "&", but that doesn't work either.
    : :
    : : Please help.
    : : Terry
    : :
    :
    :
    : I dont understand this line:
    : Activity_Date=#::Act_Date::#
    :
    : Lets assune that you are getting the date in the next page like this:
    : [code]
    : Activity_date=Request("Activity_date")
    : [/code]
    :
    : Now the sql will be:
    :
    : [code]
    : strSql="UPDATE Activities SET Activity_Date=#"&Activity_Date&"# WHERE Activity_ID="&Act_ID;
    : [/code]
    :
    : If that doesnt work,show your code.
    :
    :
    :


    Ok, here is my code and I hope that I don't go over the 16000 characters. I will be including the forms page and the update page.

    The message it too long to include both the form page and the update page.

    So here is an example of one of the field from the forms page.

    Date:
    ">

    I get Act_Date from a database query.
    Then I click submit to go to the code below.


    <% if 0 then %>

    document.write("
    The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.
    ");

    <% end if %>
    <%
    fp_sQry="UPDATE Activities SET Activity_Date='#::Active_Date::#' WHERE Activity_ID=Act_ID;"
    fp_sDefault="Act_Date="
    fp_sNoRecords="No records returned."
    fp_sDataConn="Activities"
    fp_iMaxRecords=256
    fp_iCommandType=1
    fp_iPageSize=0
    fp_fTableFormat=False
    fp_fMenuFormat=False
    fp_sMenuChoice=""
    fp_sMenuValue=""
    fp_sColTypes="&Activity_Date=135&"
    fp_iDisplayCols=16
    fp_fCustomQuery=True
    BOTID=0
    fp_iRegion=BOTID
    %>






    I did this all in Frontpage 2003.
    Thanks for the help
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories