Thread: Use of datepart() on TimeStamp.

Use of datepart() on TimeStamp.

From
"Jeffrey Silberberg"
Date:
    Using Access 97 I have a Database field defined as a time stamp being
pulled in as a data type of date/time which is correct.  My problem is that
I now what to add some criteria to select it and have tried both the
criteria of Date()-1 which results in an empty set, and createing a new
field =datepart("yymmdd", [fieldname] which results in the new column being
filed with #Error instead of a valid date only.  If I do a Between #date
time# and #date time# in the criteria this does work but not if I do
#Date()-7# and # Date()#

    It's Win/95, ODBC/32, PostgreSQL 6.40.00.05 drivers, and yes, when I
look at the data being mapped back I do get a date and time from the actual
database.

    Anyone have any ideas how I can fix this one ??

Thks,
Jeffrey M. Silberberg
CompuDesigns, Inc.
(770) 399-9464



Re: [GENERAL] Use of datepart() on TimeStamp.

From
Jose Soares
Date:

Jeffrey Silberberg wrote:

>     Using Access 97 I have a Database field defined as a time stamp being
> pulled in as a data type of date/time which is correct.  My problem is that
> I now what to add some criteria to select it and have tried both the
> criteria of Date()-1 which results in an empty set, and createing a new
> field =datepart("yymmdd", [fieldname] which results in the new column being

check for datepart() syntax:
datepart("yymmdd") returns  #Error but
datepart("yyyy") is ok.

>
> filed with #Error instead of a valid date only.  If I do a Between #date
> time# and #date time# in the criteria this does work but not if I do
> #Date()-7# and # Date()#
>
>     It's Win/95, ODBC/32, PostgreSQL 6.40.00.05 drivers, and yes, when I
> look at the data being mapped back I do get a date and time from the actual
> database.
>
>     Anyone have any ideas how I can fix this one ??
>
> Thks,
> Jeffrey M. Silberberg
> CompuDesigns, Inc.
> (770) 399-9464
>
> ************

--
Jose' Soares
Bologna, Italy                     Jose@sferacarta.com



Re: [GENERAL] Use of datepart() on TimeStamp.

From
Karel Zak - Zakkr
Date:
On Mon, 31 Jan 2000, Jose Soares wrote:

>
>
> Jeffrey Silberberg wrote:
>
> >     Using Access 97 I have a Database field defined as a time stamp being
> > pulled in as a data type of date/time which is correct.  My problem is that
> > I now what to add some criteria to select it and have tried both the
> > criteria of Date()-1 which results in an empty set, and createing a new
> > field =datepart("yymmdd", [fieldname] which results in the new column being
>
> check for datepart() syntax:
> datepart("yymmdd") returns  #Error but
> datepart("yyyy") is ok.

In next PostgreSQL version will available to_char() routines. It allow
you to use "yymmdd" date format.

                        Karel


Re: [GENERAL] Use of datepart() on TimeStamp.

From
Jose Soares
Date:

Karel Zak - Zakkr wrote:

> On Mon, 31 Jan 2000, Jose Soares wrote:
>
> >
> >
> > Jeffrey Silberberg wrote:
> >
> > >     Using Access 97 I have a Database field defined as a time stamp being
> > > pulled in as a data type of date/time which is correct.  My problem is that
> > > I now what to add some criteria to select it and have tried both the
> > > criteria of Date()-1 which results in an empty set, and createing a new
> > > field =datepart("yymmdd", [fieldname] which results in the new column being
> >
> > check for datepart() syntax:
> > datepart("yymmdd") returns  #Error but
> > datepart("yyyy") is ok.
>
> In next PostgreSQL version will available to_char() routines. It allow
> you to use "yymmdd" date format.
>
>                                                 Karel
>
> ************

I suppose do you refer to PostgreSQL date_part() function, while datepart() is a
M$Access function.

--
Jose' Soares
Bologna, Italy                     Jose@sferacarta.com



Re: [GENERAL] Use of datepart() on TimeStamp.

From
Karel Zak - Zakkr
Date:
On Tue, 1 Feb 2000, Jose Soares wrote:

> I suppose do you refer to PostgreSQL date_part() function, while datepart() is a
> M$Access function.


Sorry, next time I read it better...

Hmm, datepart/date_part, it is very simular - IMHO any Micro$oft surely copy
this function from the best SQL - from PostgreSQL :-)

                            Karel