Re: A "days at" query

From: Radu Lascae <r.nospam.lascae_at_wanadoo.nl>
Date: Fri, 08 Feb 2002 13:12:58 GMT
Message-ID: <u9Q88.57$ZV4.537_at_castor.casema.net>


For Access, use Nz(date_in, Date())
Hth,
Radu
"Eel" <eel_at_javabox.com> wrote in message news:a62a408.0201301851.2cfba420_at_posting.google.com...
> Hi,
> I'm trying to create an sql query on an ms-access
> database that will give me the "days at" a particular
> location in a factory. If I have a simple table like:
>
> "create table transactions
> date_in DATE,
> date_out DATE"
>
> I can do something like "select date_in, date_out, date_out - date_in
> as da from transactions"
>
> This works, but I have a more complex requirement which is that in
> cases where date_out = null, ie still at a location, I want to use
> current_date - date_in instead of date_out - date_in. Is there a way
> to do this? I keep getting syntax errors.
>
> I know I can get the information from scrolling the records, but I'd
> like to do it purely in sql so my report doesn't have to do its own
> sorting.
>
> Thanks!
Received on Fri Feb 08 2002 - 14:12:58 CET

Original text of this message