I am using VBA to write 0/1 in a column of my table in Access. If the difference between the dates contained in the two columns [IsYTD?] and [SO Tarihi]) is <365 I would like to write 1 in [IsYTD?] while a 0 in the other case. This is my code for the moment but it doesn't seem to work. Can you help me?
SQL3 = "UPDATE [1 - CURRENT RAW DATA SOURCE] SET [IsYTD?] = CASE " & _
"WHEN ([IsYTD?]-[SO Tarihi])<365 THEN 1 " & _
"ELSE 0 " & _
"END"
DoCmd.RunSQL SQL3