Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 how to insert a date??
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

quince
Junior Member

Canada
103 Posts

Posted - 11 January 2005 :  08:05:30  Show Profile
hi guys
how do i store for the form a date ...???

is it by assigining sysdate to the date
code:

rst("date") = sysdate

??? or not???

DarkDrift
Junior Member

USA
126 Posts

Posted - 11 January 2005 :  10:24:03  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
If you want date and time you can use the built in function of now() so if you are submitting a form to insert or update make a hidden field with the value being now()
so:

Response.Write("<input type=""hidden"" name=""date"" value=""" now() """>")

http://www.xcalliber.com - The Future of Boards
Go to Top of Page

quince
Junior Member

Canada
103 Posts

Posted - 11 January 2005 :  13:14:03  Show Profile
hey it is not working i have put it in a form and when i submit this form i get in the database now() not the date ... ??? what shell i do ?

with sql they assign for date as this :

insert into Table_name(date) values (SYSDATE);

how can i change it to use it in the asp .... btw i have another fields to enter ... so please could u find me the way or check if the way u give it to me is working or not ???
thanks a lot
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 11 January 2005 :  14:42:12  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
oops sry :) it should be """ & now() & """ sry about that
is you are using it to declare a variable or anything just do

intWhatever = now()
to display is dny where i use
Response.Write("" & now() & "") or in snitz style
Response.Write "" & now() & "" & VbNewLine

http://www.xcalliber.com - The Future of Boards

Edited by - DarkDrift on 11 January 2005 14:42:31
Go to Top of Page

quince
Junior Member

Canada
103 Posts

Posted - 11 January 2005 :  21:29:37  Show Profile
okay ... darkdrift it's not working with me ...

is this statement right ??

rstt("date") = response.write("" & now() & "")

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 12 January 2005 :  02:00:59  Show Profile
quote:
Originally posted by quince

okay ... darkdrift it's not working with me ...

is this statement right ??

rstt("date") = response.write("" & now() & "")




No it's not right. All you need is something like

rst("date") = now()


======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

quince
Junior Member

Canada
103 Posts

Posted - 12 January 2005 :  04:24:50  Show Profile
thanks a lot guys ... it worked as Doug G said ... only u need is now()...
thanks a lot for both of you guys ...
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07