CoffeeGuru
Registered User.
- Local time
- Today, 20:20
- Joined
- Jun 20, 2013
- Messages
- 121
I have tried to use a bit of code so return the Last Year and WeekNo in my database, to select some records but….
It currently fails, I think this because it returns the values as text and will then not compare to a numeric field.
Is there an easy way to change this code so it returns numbers.
qryCurrentWkYr
UPDATE: Just found the function VAL
It currently fails, I think this because it returns the values as text and will then not compare to a numeric field.
Is there an easy way to change this code so it returns numbers.
qryCurrentWkYr
Code:
[SIZE=3][FONT=Calibri]SELECT[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Right(yw,2) [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]AS week, [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Left(yw,4) [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]AS [year][/FONT][/SIZE]
[SIZE=3][FONT=Calibri]FROM ([/FONT][/SIZE]
[SIZE=3][FONT=Calibri]SELECT [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]max(year & "-" & right('0' & week,2)) [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]AS yw [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]FROM [CM-DATA]) [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]AS [%$##@_Alias];[/FONT][/SIZE]
UPDATE: Just found the function VAL
Last edited: