Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Join on inequality
Message
From
12/10/2001 07:13:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
11/10/2001 12:40:23
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00566970
Message ID:
00567473
Views:
14
>>>>I want to JOIN one table with another one. The fields should be joined by date. Instead of the exact date, I want to find a record, in the second table, whose date is closest (<=) to a certain date in the first table. In other words, an exact match may, or may not, exist.
>>>>
>>>>Can this be done with SQL - SELECT syntax? I was thinking about the workaround of writing a function that gets the PK of the second table, and then use that field for the join. However, I was wondering whether there was a simpler way to do this.
>>>>
>>>>TIA, Hilmar.
>>>
>>>Hilmar,
>>>
>>>Take a look at thread #550067. This question came up there and the solution was a non-SQL one. (or a combination)
>>>HTH
>>
>>Thank, Crescencio. It seems I need to adapt some ideas from the thread you mentioned, especially message #550500, by Sergey.
>>
>>Hilmar.
>
>Well, that message is not from Sergey but a reply to one of his messages on this thread.

That's right! I credited the wrong person, and the message is by Thom Chichester. I must have gotten confused by the fact that S.B. had a picture, and T.C. didn't.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform