I'm having problems querying access database 
Author Message
 I'm having problems querying access database

I think your problem is in the date portion of your sql. Try"

& "(Interview.interviewdate = #" & CDate(intdate) & "#" _

  >  I have been trying to query a database in vb4 and I am having
  >problems.  When I execute this code it comes back with an empty
  >dynaset?  (there is data in the table with the date in question)  I
  >have solved the problem before, but for lack of a brain I did not file
  >the answer anywhere.  Could someone help explain what I'm doing wrong
  >and how to fix it??  Please?   A troubled newbie!
  >
  >CODE:
  >Dim intdate As Date
  >
  >intdate = #5/7/97#
  >
  >Data1.RecordSource = ("SELECT DISTINCTROW Interview.interviewdate,
  >Interview.interviewtime, " _
  >& "Contacts.Firstname, Contacts.Lastname FROM Contacts INNER JOIN
  >Interview ON " _
  >& "Contacts.contactid = Interview.contactid Where " _
  >& "(Interview.interviewdate =" & CDate(intdate) & "" _
  >& ")ORDER BY Interview.interviewtime")
  >
  >



Wed, 27 Oct 1999 03:00:00 GMT
 I'm having problems querying access database

  I have been trying to query a database in vb4 and I am having
problems.  When I execute this code it comes back with an empty
dynaset?  (there is data in the table with the date in question)  I
have solved the problem before, but for lack of a brain I did not file
the answer anywhere.  Could someone help explain what I'm doing wrong
and how to fix it??  Please?   A troubled newbie!

CODE:
Dim intdate As Date

intdate = #5/7/97#

Data1.RecordSource = ("SELECT DISTINCTROW Interview.interviewdate,
Interview.interviewtime, " _
& "Contacts.Firstname, Contacts.Lastname FROM Contacts INNER JOIN
Interview ON " _
& "Contacts.contactid = Interview.contactid Where " _
& "(Interview.interviewdate =" & CDate(intdate) & "" _
& ")ORDER BY Interview.interviewtime")



Wed, 27 Oct 1999 03:00:00 GMT
 I'm having problems querying access database



Quote:
>   I have been trying to query a database in vb4 and I am having
> problems.  When I execute this code it comes back with an empty
> dynaset?  (there is data in the table with the date in question)  I
> have solved the problem before, but for lack of a brain I did not file
> the answer anywhere.  Could someone help explain what I'm doing wrong
> and how to fix it??  Please?   A troubled newbie!

> CODE:
> Dim intdate As Date

> intdate = #5/7/97#

> Data1.RecordSource = ("SELECT DISTINCTROW Interview.interviewdate,
> Interview.interviewtime, " _
> & "Contacts.Firstname, Contacts.Lastname FROM Contacts INNER JOIN
> Interview ON " _
> & "Contacts.contactid = Interview.contactid Where " _
> & "(Interview.interviewdate =" & CDate(intdate) & "" _
> & ")ORDER BY Interview.interviewtime")

If the field is a Date/Time field, it might have the date but ther might be
a time associated.  so 5/7/97 <> 5/7/97 12:01 am.  The serial value for
each is different.  5/7/97 is the same as 5/7/97 12:00 am.

Also if 'intdate' is declared as a date var, why are you converting it to a
date

--
JD

** When all else fails, RTFM



Fri, 29 Oct 1999 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Having problem in ms access query

2. Having problems with SIMPLE query in VB 6 and Access XP, Please Help

3. Problem's accessing multi-user Access'97 database from within MTS

4. Visual Basic ado having problem accessing informix database

5. I'm having trouble with this sql query

6. I'm having problems getting connected

7. I'm having PROBLEMS whit a project...

8. I'm having problems getting connected

9. I-Net Installation: Try this if you're having problems

10. I'm having problems with Replication Installation

11. Having "HAVING" problems with GROUP BY.


 
Powered by phpBB® Forum Software