Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Querying for dates

4 posts in DataWindow Last posting was on 2009-07-16 16:45:10.0Z
S B Gogia Posted on 2009-07-13 02:31:03.0Z
From: "S B Gogia" <gogia7@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Querying for dates
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a5a9c67$2@forums-3-dub.sybase.com>
Date: 12 Jul 2009 19:31:03 -0700
X-Trace: forums-3-dub.sybase.com 1247452263 10.22.241.152 (12 Jul 2009 19:31:03 -0700)
X-Original-Trace: 12 Jul 2009 19:31:03 -0700, vip152.sybase.com
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89625
Article PK: 418813

Hi All,
PB 9.03, SQL Anwhere 8

When I do a filter in the Datawindow preview mode or in the database
directly using

first_visit BETWEEN '2007-06-30' AND '2009-07-01'

it works OK (Frst_visit is the column name, we are using British date
formats (dd/mm/yy)

but the same if done in Query mode at runtime generates an error ("Cannot
covert '2009-' to a timestamp". Changing the format to any other or even
adding the Function Date ie
BETWEEN Date('30/06/2007') AND date('01/07/2009')
results in a simlar error (cannot convert '01/07/200' to a Timestamp

In both if we notice the complete string is missing

Of course use of >'30/06/07' In one row and <'01/07/09' in the next
retrieves all the rows as the interlinking critieria is taken as OR for the
two rows

What may I be doing wrong??

TIA


Chris Pollach Posted on 2009-07-13 11:22:34.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4a5a9c67$2@forums-3-dub.sybase.com>
Subject: Re: Querying for dates
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a5b18fa$1@forums-3-dub.sybase.com>
Date: 13 Jul 2009 04:22:34 -0700
X-Trace: forums-3-dub.sybase.com 1247484154 10.22.241.152 (13 Jul 2009 04:22:34 -0700)
X-Original-Trace: 13 Jul 2009 04:22:34 -0700, vip152.sybase.com
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89628
Article PK: 418815

Hi SB;

You must use the ANSI standard yyyy-mm-dd.
That is how all dates in DBMS are stored internally.

--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com

"S B Gogia" <gogia7@gmail.com> wrote in message
news:4a5a9c67$2@forums-3-dub.sybase.com...
> Hi All,
> PB 9.03, SQL Anwhere 8
>
> When I do a filter in the Datawindow preview mode or in the database
> directly using
>
> first_visit BETWEEN '2007-06-30' AND '2009-07-01'
>
> it works OK (Frst_visit is the column name, we are using British date
> formats (dd/mm/yy)
>
> but the same if done in Query mode at runtime generates an error ("Cannot
> covert '2009-' to a timestamp". Changing the format to any other or even
> adding the Function Date ie
> BETWEEN Date('30/06/2007') AND date('01/07/2009')
> results in a simlar error (cannot convert '01/07/200' to a Timestamp
>
> In both if we notice the complete string is missing
>
> Of course use of >'30/06/07' In one row and <'01/07/09' in the next
> retrieves all the rows as the interlinking critieria is taken as OR for
> the two rows
>
> What may I be doing wrong??
>
> TIA
>
>


S B Gogia Posted on 2009-07-16 16:10:03.0Z
From: "S B Gogia" <gogia7@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4a5a9c67$2@forums-3-dub.sybase.com> <4a5b18fa$1@forums-3-dub.sybase.com>
Subject: Re: Querying for dates
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a5f50db$1@forums-3-dub.sybase.com>
Date: 16 Jul 2009 09:10:03 -0700
X-Trace: forums-3-dub.sybase.com 1247760603 10.22.241.152 (16 Jul 2009 09:10:03 -0700)
X-Original-Trace: 16 Jul 2009 09:10:03 -0700, vip152.sybase.com
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89647
Article PK: 418834

Well thats exactly what I did ( mentioned in the first para- only removed
the columna name becuse that is implicit while in query mode so the syntax
used was
"BETWEEN '2007-06-30' AND '2009-07-01' "
Got en error message "Cannot convert '2009-' to a timestamp".

regards

"Chris Pollach" <cpollach@travel-net.com> wrote in message
news:4a5b18fa$1@forums-3-dub.sybase.com...
> Hi SB;
>
> You must use the ANSI standard yyyy-mm-dd.
> That is how all dates in DBMS are stored internally.
>
> --
> Regards ... Chris
> ISUG - NA RUG Director
> http://chrispollach.pbdjmagazine.com
>
>
> "S B Gogia" <gogia7@gmail.com> wrote in message
> news:4a5a9c67$2@forums-3-dub.sybase.com...
>> Hi All,
>> PB 9.03, SQL Anwhere 8
>>
>> When I do a filter in the Datawindow preview mode or in the database
>> directly using
>>
>> first_visit BETWEEN '2007-06-30' AND '2009-07-01'
>>
>> it works OK (Frst_visit is the column name, we are using British date
>> formats (dd/mm/yy)
>>
>> but the same if done in Query mode at runtime generates an error ("Cannot
>> covert '2009-' to a timestamp". Changing the format to any other or even
>> adding the Function Date ie
>> BETWEEN Date('30/06/2007') AND date('01/07/2009')
>> results in a simlar error (cannot convert '01/07/200' to a Timestamp
>>
>> In both if we notice the complete string is missing
>>
>> Of course use of >'30/06/07' In one row and <'01/07/09' in the next
>> retrieves all the rows as the interlinking critieria is taken as OR for
>> the two rows
>>
>> What may I be doing wrong??
>>
>> TIA
>>
>>
>
>


Chris Pollach Posted on 2009-07-16 16:45:10.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4a5a9c67$2@forums-3-dub.sybase.com> <4a5b18fa$1@forums-3-dub.sybase.com> <4a5f50db$1@forums-3-dub.sybase.com>
Subject: Re: Querying for dates
Lines: 69
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a5f5916$2@forums-3-dub.sybase.com>
Date: 16 Jul 2009 09:45:10 -0700
X-Trace: forums-3-dub.sybase.com 1247762710 10.22.241.152 (16 Jul 2009 09:45:10 -0700)
X-Original-Trace: 16 Jul 2009 09:45:10 -0700, vip152.sybase.com
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89649
Article PK: 418838

Ahhhh ... if this is not a DATE type of column but a DateTime data type you
would have to change it to the ANSI standard for that data type ...

BETWEEN '2007-06-30 00:00:00' AND '2009-07-01 23:59:59'

See if that helps your aligning DML processor! :-)

"S B Gogia" <gogia7@gmail.com> wrote in message
news:4a5f50db$1@forums-3-dub.sybase.com...
> Well thats exactly what I did ( mentioned in the first para- only removed
> the columna name becuse that is implicit while in query mode so the syntax
> used was
> "BETWEEN '2007-06-30' AND '2009-07-01' "
> Got en error message "Cannot convert '2009-' to a timestamp".
>
> regards
>
> "Chris Pollach" <cpollach@travel-net.com> wrote in message
> news:4a5b18fa$1@forums-3-dub.sybase.com...
>> Hi SB;
>>
>> You must use the ANSI standard yyyy-mm-dd.
>> That is how all dates in DBMS are stored internally.
>>
>> --
>> Regards ... Chris
>> ISUG - NA RUG Director
>> http://chrispollach.pbdjmagazine.com
>>
>>
>> "S B Gogia" <gogia7@gmail.com> wrote in message
>> news:4a5a9c67$2@forums-3-dub.sybase.com...
>>> Hi All,
>>> PB 9.03, SQL Anwhere 8
>>>
>>> When I do a filter in the Datawindow preview mode or in the database
>>> directly using
>>>
>>> first_visit BETWEEN '2007-06-30' AND '2009-07-01'
>>>
>>> it works OK (Frst_visit is the column name, we are using British date
>>> formats (dd/mm/yy)
>>>
>>> but the same if done in Query mode at runtime generates an error
>>> ("Cannot covert '2009-' to a timestamp". Changing the format to any
>>> other or even adding the Function Date ie
>>> BETWEEN Date('30/06/2007') AND date('01/07/2009')
>>> results in a simlar error (cannot convert '01/07/200' to a Timestamp
>>>
>>> In both if we notice the complete string is missing
>>>
>>> Of course use of >'30/06/07' In one row and <'01/07/09' in the next
>>> retrieves all the rows as the interlinking critieria is taken as OR for
>>> the two rows
>>>
>>> What may I be doing wrong??
>>>
>>> TIA
>>>
>>>
>>
>>
>
>