M
mark.godecke
I'm using Access 2000. There are two Visual Foxpro tables I have
created links to with ODBC, called 'client' and 'meals'. I'm trying to
use a query on them, but it gives unusual results. Here is the query:
SELECT Client.PersonID, Client.LastName, Client.FirstName,
Meals.TempStop, Meals.Restart, Meals.MealDate,
UserEnteredDate.SearchDate
FROM Client, Meals, UserEnteredDate
WHERE LastName = 'SMITH' AND MealDate = SearchDate
'UserEnteredDate' is an Access table, with 'SearchDate' formated as a
Short Date. When I run the query, I get results like these (I'm
leaving out the FirstName field so I can fit it all on one line):
PersonID LastName TempStop Restart MealDate SearchDate
2350 SMITH 12:00:00AM 12:00:00AM 5/24/2005 7/12/2006
2350 SMITH 5/9/2005 12/14/2005 5/24/2005 7/12/2006
There are two major problems with this. One, it does not seem to be
bothering to match the MealDate with the SearchDate. Two, Access is
reading Foxpro's null values as 12:00:00AM. What I would like to be
able to do is exclude results that have 12:00:00AM entered for
TempStop, as eventually I will be putting in a BETWEEN statement which
will include this field. When I tried adding a WHERE statement for
this, it also had no effect. I tried excluding it as both '12:00:00AM'
and just excluding null values. Does anybody have any suggestions?
I'm pretty new to all this SQL stuff, so I'd really appreciate not only
code suggestions to try, but an explanation of why I'm getting the
results I'm getting.
created links to with ODBC, called 'client' and 'meals'. I'm trying to
use a query on them, but it gives unusual results. Here is the query:
SELECT Client.PersonID, Client.LastName, Client.FirstName,
Meals.TempStop, Meals.Restart, Meals.MealDate,
UserEnteredDate.SearchDate
FROM Client, Meals, UserEnteredDate
WHERE LastName = 'SMITH' AND MealDate = SearchDate
'UserEnteredDate' is an Access table, with 'SearchDate' formated as a
Short Date. When I run the query, I get results like these (I'm
leaving out the FirstName field so I can fit it all on one line):
PersonID LastName TempStop Restart MealDate SearchDate
2350 SMITH 12:00:00AM 12:00:00AM 5/24/2005 7/12/2006
2350 SMITH 5/9/2005 12/14/2005 5/24/2005 7/12/2006
There are two major problems with this. One, it does not seem to be
bothering to match the MealDate with the SearchDate. Two, Access is
reading Foxpro's null values as 12:00:00AM. What I would like to be
able to do is exclude results that have 12:00:00AM entered for
TempStop, as eventually I will be putting in a BETWEEN statement which
will include this field. When I tried adding a WHERE statement for
this, it also had no effect. I tried excluding it as both '12:00:00AM'
and just excluding null values. Does anybody have any suggestions?
I'm pretty new to all this SQL stuff, so I'd really appreciate not only
code suggestions to try, but an explanation of why I'm getting the
results I'm getting.