str_rangedate = dateadd("d",-180, now())
if str_vardate >= str_rangedate then
...
The above code makes str_range date 180's ago according to "response.write str_rangedate"
But the if statement seems to include every record? if I switch around the >= to <= it still doesn't work as expected. I'm not a programmer, whats wrong with my code?
What value does str_vardate return? If rs(registration_date) is a date only field, then you might try using the Date() function instead of the Now() function which returns a date/time value. What does the rest of your If statement look like.
str_vardate returns a variable datetime stamp similar to str_rangedate.
The IF statement is just this:
if str_vardate >= str_rangedate then
str_cellcolour1="orange"
else str_cellcolour1 ="green"
end if
Where the cellcolour variable changes the colour on a cell
Any ideas? I have the theory down ok it just seems to not colour in what I expect. I have done this successfully for other variables such as "amount" it's just this datetime thing causing me issues...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.