How does your variable looks like when you put it in an input box?
If it's a number and [DateFrom] and [DateTo] are interpreted as dates, it should work.
If it's not a number, but the formatted date text, but in your standard date format, try enclosing the variable in single quotes:
IF ([DateFrom] < '$(vSelectedDate)' AND [DateTo] > '$(vSelectedDate)', 'T', 'F') AS Status
As you see, it's probably a matter of value formatting and interpreting.
try to see my attachment and tell me if it's different from your.
You'd adapt the date format in order to have a match with your script.
If you can post a snippet of code or your application.
Let me know.
196769.qvw 169.2 K