Concatenated Date Field not formatting correctly

You lost me again with the CDate & CVDate, but presumably I don't need these now ?
You need not worry. They both coerce values to date types. The only difference is CVDate() will not bomb when it encounters Null.
 
Interesting Brian. I just tested it out and it yielded the same result. I still don't think that Nz() returns a String because Nz(1) + Nz(1) should equal 11 if that was the case. I believe that value types returned from Nz() aren't taken into considertion when sorting in Access. Awful really!

Just noticed this post, well 30 mins ago before I did some checking.
Please note that I am talking pre 2007 so things may have changed.

Access help says that NZ returns a variant, but I believe that the use of the + causes the compiler to return a number in the example you give, however if those numbers were in fields say flda and fldb then a: nz(flda) b: nz(fldb) would return strings and a+b would return 11, of course nz(flda)+nz(fldb) would give 2

Dates always return strings and you must use CDate to return a date.

Perhaps if the NZ was used inside another function say Datediff it would be ok

Brian

I await an expert to tell me I'm talking rubbish and that observations and tests are rubbish.:o
 

Users who are viewing this thread

Back
Top Bottom