Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select data from table

Status
Not open for further replies.

ersatz

Programmer
Oct 29, 2002
114
US
Hi,
I take data from a server and I put in my table1.
All it's ok.
After that, I want to take data from table1,make some calculus and put data in table2:
SQL0 = "SELECT * from DECEMBRE where Date=#" & d1 & "# and Time=#" & d2 & "#"
Set r0 = db1.OpenRecordset(SQL0, dbOpenDynaset)
v = r0.Fields("field1")

My programme stop here and I have this error:
Run-time error '3021'
No current record.
v=empty
But if I go in table1 I find this record.
Can somebody help me, please?
Regards,
ersatz



 
Hi ersatz


In your SQL you are using the pound sign which indicates to me that the fields in the database are defined as date fields ?

Are you sure that D1 and D2 are also defined as Date values

Example if maybe try something like the following

d1 = Format(CDate(d1,"MM/DD/YYY"))
d2 = Format(CDate(d2,"Short Time"))

SQL0 = "SELECT * from DECEMBRE where Date=#" & d1 & "# and Time=#" & d2 & "#"

Hope it helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top