|
-
May 29th, 2001, 10:34 AM
#1
decalration problem - something stupid I think! HELP!
I have this line in VB cobe which works fine,
Set Rst = dbs.OpenRecordset("SELECT count(*) as TotalCount FROM Cattle Where DOB > CDate('27/Feb/00');")
but I want it to get the last date from another table so I write this
Set Rst = dbs.OpenRecordset("SELECT count(*) as TotalCount FROM Cattle Where DOB > Date01;")
with declaration:
--
Dim Date01, Date02, Date03, Date04, Date05, Date06 As Date
Dim dbs As Database, Rst As Recordset, Rst2 As Recordset
Dim TotalCount As Integer
Set dbs = OpenDatabase("Cattle.mdb")
' Get government dates from table "Dates"
Set Rst2 = dbs.OpenRecordset("SELECT Period01, Period02, Period03, Period04, Period05, Period06 FROM Dates;")
Date01 = Rst2.Fields(0)
Date02 = Rst2.Fields(1)
Date03 = Rst2.Fields(2)
Date04 = Rst2.Fields(3)
Date05 = Rst2.Fields(4)
Date06 = Rst2.Fields(5)
Rst2.Close
--
BUT IT DOESNT WORK!!!! says something about invalid parameter...
what could be wrong?!?! please help! thanks a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|