If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How to check/update yes/no fields and set date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-08, 10:17
Nerz Nerz is offline
Registered User
 
Join Date: Jun 2008
Posts: 11
Question How to check/update yes/no fields and set date

Can some1 help me with this? How do i check/update yes/no fields of a DB. Also how can i set the current date plus 2 weeks in a date/time field with the format being general date (6/30/08). And to save some time how can i check today's date against it?
Reply With Quote
  #2 (permalink)  
Old 06-30-08, 11:53
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
It would help if we knew what database you were asking about. Generally speaking, "yes/no" fields are represented by a bit that is either on or off (1 or 0). The date part of your question depends entirely on the type of database you use.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #3 (permalink)  
Old 06-30-08, 14:38
Nerz Nerz is offline
Registered User
 
Join Date: Jun 2008
Posts: 11
i

i figured out the yes/no fields by just setting it to true. it is a MS access DB. doubt it makes a difference but it's suffix is .mdb instead of the newer one. i think i found out how to add to the date from http://www.w3schools.com/Vbscript/func_dateadd.asp. but i'm wondering how i can post the current date in the DB.
Reply With Quote
  #4 (permalink)  
Old 06-30-08, 14:49
Nerz Nerz is offline
Registered User
 
Join Date: Jun 2008
Posts: 11
I've found a code snippet to view the date.
Response.Write ("The time on the server is: " & Date())

how can i change this to take the return from Date() to a variable and then print line.

though this i wrong its what i mean...
date = Date()
Response.Write(date)
Reply With Quote
  #5 (permalink)  
Old 06-30-08, 19:37
Nerz Nerz is offline
Registered User
 
Join Date: Jun 2008
Posts: 11
i found it out but if anyone can help me with this one id appreciate it.

here is some of the code...

Dim dtmMyDate
Dim dtmMyDate2

dtmMyDate = Date()
dtmMyDate2 = (DateAdd("d",14,dtmMyDate))

rsProjDatabase2.Fields("LoginDate") = dtmMyDate2

but i'm getting this error...

Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/checkexist.asp, line 71
Reply With Quote
  #6 (permalink)  
Old 06-30-08, 19:43
Nerz Nerz is offline
Registered User
 
Join Date: Jun 2008
Posts: 11
Sorry for any inconvenience but I found my problem. Forgot to add tbl.LoginDate in SQL statment
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On