🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Macro using dates for SQL

User: "ecdbert"
New Altair Community Member
Updated by Jocelyn
Hi:
I'm trying to use a macro with date in an SQL statement but I'm getting an error from the SQL side. Here is part of the SQL statement: 
Declare @fDate date, @tdate date , @processingdate date, @lag int =%{lag}
SET @fDate =%{themonth}

error message is "Operand type clash: int is incompatible with date."

How do I resolve this?

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "ecdbert"
    New Altair Community Member
    OP
    Accepted Answer
    UPDATE: I've resolved this by using 'concat' to add single quotes before and after the macro value in a 'Generate Macro' operator.