Hi
I am trying to identify the financial year within which a transaction occurs. I have tried to use a format to circumvent confusion between US and UK dates but I have clearly got something wrong in the SQL.
I wonder if any of you wizards can spot my mistake?
I have cobbled it together from various other things I have used and I am pretty sure I must have some error in my inverted commas but cannot see where.
Any help very much appreciated
Thanks and best wishes
I am trying to identify the financial year within which a transaction occurs. I have tried to use a format to circumvent confusion between US and UK dates but I have clearly got something wrong in the SQL.
I wonder if any of you wizards can spot my mistake?
Code:
intYear = DLookup("lngCurYear", "tblCurrentYear", "Format(Me.txtRecD, 'yyyymmdd') > " & Format(CDate([dtmCurYearStart]), "yyyymmdd") & " And Format(Me.txtRecD, 'yyyymmdd') < " & Format(CDate([dtmCurYearEnd]), "yyyymmdd") & "")
Any help very much appreciated
Thanks and best wishes