Can anyone see anything clearl wrong with this script and why it appears to be treating my date as a string?
The code is creating a Weekend date based on a Thursday weekend. The logic is working but when I try to use this in a variable in set analysis it wont recognize it as a date even if I try to format it. But I created the same code converting to a NUM() and it shows the correct number for each date. In my set analysis I am using the max() function to create a variable of the max available week selected then I need to use that in set analysis to compare to the field below but it wont recognize it. No error, it just ignores it. Frustrating but I havent worked with date variables in quite a while.
Set Analysis is dependant on the format of the date as well as the value. This seems a bit odd to me, but it is the case. As Jagan suggests you need to format the date that you are pushing into Set Analysis, but as you are specifying a fixed format in your load script you need to specify exactly the same format in Set Analysis, eg:
Your option #1 does not return any values for the WeekEnd field and I tried option 2 previously. This one is a mystery to me. Very frustrating. I am wondering if the weekend function is causing the problem. the %DateKey field works using the same TempDate , it is just the Thu_WeekEnd field that doesnt work and only difference is the WeekEnd() function.