Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL and DateTime Comparison
Message
From
26/02/2001 21:31:13
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00479826
Message ID:
00479861
Views:
51
Jill,

You said that sometimes it works and sometimes it doesn't? Is it possible that the date/time field in the two tables has a slightly different value for the records that you think should match?

Can you test your code on copies of the two tables that have just a few records with known good matching values? That's usually a good debugging technique, and with small tables you can easily verify the correct values are there.

Better still, if you can isolate a pair of records that you think should match but fail on the SELECT statement, put just those records into your test tables (1 record in each). You then have a simpler test environment.

Your code here looks like it should work if the fields have the correct values.
Select *, prnInvcur.procdate As myprocdate ;
From prnInvCur, whInvDetail;
Where prnInvCur.Invoice = whinvdetail.Invoice ;
And prnInvCur.procdate = whinvdetail.procdate ;
Order By prnInvCur.Invoice Into Table prnInvoice
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform