PDA

View Full Version : IFs and all records


scroots
11-17-2002, 07:56 PM
i have a databse with a field called date (which has the format of a date) how can i compare what is enterd in a textbox to see if there is a date already the same as that in the database, if there is how can i set a value in a textbox to 1 and if it does not exist set to 0.

thanks in advance
scroots

whammy
11-17-2002, 08:00 PM
You might want to look at the post I answered earlier here:

http://www.codingforums.com/showthread.php?s=&threadid=9861

:D

There are lots of other date posts too.

scroots
11-17-2002, 08:21 PM
i have searched multipul times, and haven`t found the stuff i require. what i need a script to do is check the entire database(see post #1)

scroots

whammy
11-17-2002, 08:37 PM
You mean a SQL Statement - right?

SQL = "SELECT * FROM tablename WHERE datefield = '" & mydate & "'"

Set rs = Conn.Execute(SQL)

If NOT rs.EOF Then
'your date was found
Else
'it wasn't found
End If

:confused:

scroots
11-18-2002, 08:52 PM
thanks whammy, it will proably do. if i need anymore help i`ll post back.

cheers
scroots