General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
I don't believe you can have the level of uncertainty you are hoping for in the join condition. Have you considered using BETWEEN() in the join condition.
>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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only