PC Review


Reply
Thread Tools Rate Thread

date format in expression

 
 
Brian
Guest
Posts: n/a
 
      18th May 2006
I have a report that is derived from an iif expression within a query. -
=iif([NAdate]=true,"NA",[date])

The report field always returns the date in the MM/DD/YYYY format. I Just
want to display the M/D format (which works fine on the fields that are not
expressions) regardless of whether I have entered M/D in the format
properties of either the report and/or query field. What am I missing?

Thanks
Brian


 
Reply With Quote
 
 
 
 
tina
Guest
Posts: n/a
 
      18th May 2006
try using the Format() function to explicitly format the date value, as

=IIf([NAdate]=true,"NA",Format([date], "m\/d\/yyyy"))

hth


"Brian" <(E-Mail Removed)> wrote in message news:zxQag.1298$rS6.238@fed1read11...
> I have a report that is derived from an iif expression within a query. -
> =iif([NAdate]=true,"NA",[date])
>
> The report field always returns the date in the MM/DD/YYYY format. I Just
> want to display the M/D format (which works fine on the fields that are

not
> expressions) regardless of whether I have entered M/D in the format
> properties of either the report and/or query field. What am I missing?
>
> Thanks
> Brian
>
>



 
Reply With Quote
 
Brian
Guest
Posts: n/a
 
      18th May 2006
Ok, that works - thanks

Now my question is why will it not accept the format properties of the
field - or is that one of the quirks we are supposed to live with?


"tina" <(E-Mail Removed)> wrote in message
news:sJQag.118384$(E-Mail Removed)...
> try using the Format() function to explicitly format the date value, as
>
> =IIf([NAdate]=true,"NA",Format([date], "m\/d\/yyyy"))
>
> hth
>
>
> "Brian" <(E-Mail Removed)> wrote in message news:zxQag.1298$rS6.238@fed1read11...
>> I have a report that is derived from an iif expression within a query. -
>> =iif([NAdate]=true,"NA",[date])
>>
>> The report field always returns the date in the MM/DD/YYYY format. I Just
>> want to display the M/D format (which works fine on the fields that are

> not
>> expressions) regardless of whether I have entered M/D in the format
>> properties of either the report and/or query field. What am I missing?
>>
>> Thanks
>> Brian
>>
>>

>
>



 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      18th May 2006
Access can only apply the Format property if the field consistently contains
a date. NA is not a date.

Tina's workaround solves the problem because the Format() function spits out
text too.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Brian" <(E-Mail Removed)> wrote in message news:EXQag.1300$rS6.1013@fed1read11...
> Ok, that works - thanks
>
> Now my question is why will it not accept the format properties of the
> field - or is that one of the quirks we are supposed to live with?
>
>
> "tina" <(E-Mail Removed)> wrote in message
> news:sJQag.118384$(E-Mail Removed)...
>> try using the Format() function to explicitly format the date value, as
>>
>> =IIf([NAdate]=true,"NA",Format([date], "m\/d\/yyyy"))
>>
>> hth
>>
>>
>> "Brian" <(E-Mail Removed)> wrote in message news:zxQag.1298$rS6.238@fed1read11...
>>> I have a report that is derived from an iif expression within a query. -
>>> =iif([NAdate]=true,"NA",[date])
>>>
>>> The report field always returns the date in the MM/DD/YYYY format. I
>>> Just
>>> want to display the M/D format (which works fine on the fields that are

>> not
>>> expressions) regardless of whether I have entered M/D in the format
>>> properties of either the report and/or query field. What am I missing?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date format expression in table Yecenia Microsoft Access Database Table Design 4 10th Jun 2009 11:55 PM
FORMAT A DATE IN AN EXPRESSION =?Utf-8?B?U2FtbWll?= Microsoft Access Form Coding 3 1st Mar 2007 06:43 AM
UK Date Format Regular Expression Niclas Microsoft ASP .NET 2 2nd Dec 2005 05:50 PM
Syntax error in date in query expression for Swiss Italian date format Timothy M Hodgson Microsoft Access Queries 2 25th Mar 2004 04:46 PM
date format in expression =?Utf-8?B?c21rMg==?= Microsoft Access Form Coding 2 31st Jan 2004 07:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:15 PM.