I want to check if a field in one data extension is greater (after) a field in another data extension.

I currently have op.[EventDate] > (acc.[Most_Recent_Auto_Loan_Application__c]+14) within the query but it's not returning any results - these fields are data/time data types, and my assumption is that I'm missing something because of the data type.

If anyone has any suggestions for a fix it would be very appreciated!


Here's a sargable way to approach it -- one that handles the time portions of the date-times.

op.eventDate > convert(date, acc.[Most_Recent_Auto_Loan_Application__c]+13)
and op.eventDate <= convert(date, acc.[Most_Recent_Auto_Loan_Application__c]+14)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.