How can I select rows based on the current date in numeric or character fields?
The SQL CurDate function returns a date value, which cannot be directly compared to a number or an unformatted character value. You must do some conversion before the comparison. Use SQL functions to get the year, month, and day of the date as integers, and then create a numeric date in the form YYYYMMDD. See the code in Example: Selecting records based on the current date.
Related Questions
- What is the complete list of fields wherein there is a conflict between AOPO character notation and DonorNet numeric notation? Can we get a document illustrating how these values map up?
- Okay, now I can select fields in a single row, but how do I quickly select a field (or fields) in multiple rows?
- How can I select rows based on the current date in numeric or character fields?