Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Date Output Fomatting Problem

Status
Not open for further replies.

CSHANKY

IS-IT--Management
Jun 4, 2003
20
US
I have a table with 3 fields:

1. [del_complete] is a yes/no field
2. [due_dt] is a date field, medium date format
3. [status] is a text field


I created a query using the 3 fields and added "X" which is a calculated field and coded it as:

X: IIf([del_complete]=-1,"Complete",[due_dt] & " " & [status])

I would like to know what modification I should make to the code above so that [due_dt] output is displayed in medium date format (e.g. 23-Jan-04) in the "X" field, when relevant. Currenty it shows mm/dd/yy (e.g. 01/23/04).

Thanks a LOT to the forum folks for their help !


Example:

NOW
----

del_complete due_dt status X
------------ ----- ------ ------
Yes 12-Dec-03 howdy Complete
No 01-Jan-94 hello 1/1/04 hello


I WOULD LIKE
------------

del_complete due_dt status X
------------ ----- ------ ------
Yes 12-Dec-03 abc Complete
No 01-Jan-94 def 01-Jan-04 hello
 
Dates are always stored in the exact same way as every other date in every MDB, in every language. It is simply a floating point number containing the number of days (and partial days) since Dec 30, 1899. Try this expression:
X: IIf([del_complete]=-1,"Complete",Format([due_dt],"dd-mmm-yy") & " " & [status])

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top