G
Guest
I have an expression that I have calculated in a query that returns a string
like "1/1/2005"; however, the expression is a string. How do I convert it to
a date? My current expression is as follows ...
Beginning: Max(IIf([winfas_Book].[FiscYrEnd]=12,"1/1/" &
DatePart("yyyy",[winfas_BookParts].[CurrentLsDeprDate]),[winfas_Book].[FiscYrEnd]+1
& "/1/" &
IIf(DatePart("m",[winfas_BookParts].[CurrentLsDeprDate])>[winfas_Book].[FiscYrEnd],DatePart("yyyy",[winfas_BookParts].[CurrentLsDeprDate]),DatePart("yyyy",[winfas_BookParts].[CurrentLsDeprDate])-1)))
The query is a "Make Table Query" and I want the created table to recognize
it as a date without having to create a procedure that changes the table's
field properties to a date -- it seems there would be a simple expression
that I can add to my formula above to treat the outcome as a date. I guess I
could possibly use a "DateAdd" function to deal with my issue above, but I
would like to be able to see if there is a way to do it with what I have
above.
Thank you --
like "1/1/2005"; however, the expression is a string. How do I convert it to
a date? My current expression is as follows ...
Beginning: Max(IIf([winfas_Book].[FiscYrEnd]=12,"1/1/" &
DatePart("yyyy",[winfas_BookParts].[CurrentLsDeprDate]),[winfas_Book].[FiscYrEnd]+1
& "/1/" &
IIf(DatePart("m",[winfas_BookParts].[CurrentLsDeprDate])>[winfas_Book].[FiscYrEnd],DatePart("yyyy",[winfas_BookParts].[CurrentLsDeprDate]),DatePart("yyyy",[winfas_BookParts].[CurrentLsDeprDate])-1)))
The query is a "Make Table Query" and I want the created table to recognize
it as a date without having to create a procedure that changes the table's
field properties to a date -- it seems there would be a simple expression
that I can add to my formula above to treat the outcome as a date. I guess I
could possibly use a "DateAdd" function to deal with my issue above, but I
would like to be able to see if there is a way to do it with what I have
above.
Thank you --