Format as date

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have the following setup in a query. When the query runs the ShipDate is no
acting like a date. It will not short like a date. It sorts more like numbers.
If EstShipDate and QueShipDate are date type why won't this act like a date?

Basically I am saying if EstShipDate is populated then use that data else use
QueShipDate.

ShipDate: Nz([EstShipDate],[QueShipDate])

Does anyone have any ideas?
 
L

Lord Kelvan

can you post your query and a sample of the data from the query

to get the query open the query then click view then click sql view
and past it here and then also paste a sample of the data that the
query returns when you run it

Regards
Kelvan
 
L

Lord Kelvan

as a massive guess try

ShipDate: cdate(Nz([EstShipDate],[QueShipDate]))

because as far as i know Nz returns a string not a date or a number.

alternativally you could use

ShipDate: iif(isnull([EstShipDate]),[QueShipDate],[EstShipDate])

if either of the above dont work do my privious post

Regards
Kelvan
 
K

KARL DEWEY

Try using an IIF statement instead --
ShipDate: IIF([EstShipDate] Is Null,[QueShipDate], [EstShipDate])
 
M

mattc66 via AccessMonster.com

I tried the cdate suggestion. That worked great - thanks

Lord said:
as a massive guess try

ShipDate: cdate(Nz([EstShipDate],[QueShipDate]))

because as far as i know Nz returns a string not a date or a number.

alternativally you could use

ShipDate: iif(isnull([EstShipDate]),[QueShipDate],[EstShipDate])

if either of the above dont work do my privious post

Regards
Kelvan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top