From: sam on
Hi All,

How can I display current date and time in query output?
Is there a way to do this?

Thanks in advance
From: Duane Hookom on
You can use the built-in functions of Date() and Time() in the query.

Today: Date()
RightNow: Time()

--
Duane Hookom
Microsoft Access MVP


"sam" wrote:

> Hi All,
>
> How can I display current date and time in query output?
> Is there a way to do this?
>
> Thanks in advance
From: John W. Vinson on
On Sun, 25 Apr 2010 20:39:01 -0700, sam <sam(a)discussions.microsoft.com> wrote:

>Hi All,
>
>How can I display current date and time in query output?
>Is there a way to do this?
>
>Thanks in advance

In each record of the query? in a report header? on a form? What's the
context?

The builtin function Now() returns the current date and time; you could put a
calculated field in the query by typing

TheTime: Now()

in a vacant Field cell.

In a report or form, you can set the control source of a textbox to

=Now()

for the same purpose.
--

John W. Vinson [MVP]
From: sam on
Hi Duane,

So my query will look like: SELECT FName, LName, PhNo FROM Customer_Table
WHERE LName = "Smith" AND CurrentDate = Time();

The issue here is, I dont have Time or Date field in Customer_Table
How can I display Time or Date in query output if there is no such field as
Time or Date in Customer_Table?

Thanks in advance.

"Duane Hookom" wrote:

> You can use the built-in functions of Date() and Time() in the query.
>
> Today: Date()
> RightNow: Time()
>
> --
> Duane Hookom
> Microsoft Access MVP
>
>
> "sam" wrote:
>
> > Hi All,
> >
> > How can I display current date and time in query output?
> > Is there a way to do this?
> >
> > Thanks in advance
From: sam on
Hi John,

I have a Query thats displays results in a table view, the query looks like
this.

SELECT FName, LName, PhNo FROM Customer_Table
WHERE LName = "Smith";

Now, I want current date to display in the output of this query for each
result displayed. So basically like having the query output with consists of
the following columns.

FName, LName, PhNo, CurrentDate

Is this possible?

How can I do this?

Thanks in advance



"John W. Vinson" wrote:

> On Sun, 25 Apr 2010 20:39:01 -0700, sam <sam(a)discussions.microsoft.com> wrote:
>
> >Hi All,
> >
> >How can I display current date and time in query output?
> >Is there a way to do this?
> >
> >Thanks in advance
>
> In each record of the query? in a report header? on a form? What's the
> context?
>
> The builtin function Now() returns the current date and time; you could put a
> calculated field in the query by typing
>
> TheTime: Now()
>
> in a vacant Field cell.
>
> In a report or form, you can set the control source of a textbox to
>
> =Now()
>
> for the same purpose.
> --
>
> John W. Vinson [MVP]
> .
>