Date Tilde Variable in Query

Date Tilde Variable in Query

Post by Bruce Campbel » Wed, 12 Jun 1996 04:00:00



Hi,
I'm using PFW5.0 and have a date tilde variable in a query statement in
OPAL. Input for this, and other, variables is obtained via a dlg box. The
date is obtained in the format mm/dd/yy. But everywhere else in the
system the user has insisted on date being in the format dd.mm.yy
(Australian date format).

The variable has been set up as:-

var
        LostDate     Date
endvar

In the query statement in the "Date Found" field I have the statement
|Check >~(LostDate - 1)| . An inspection of variables with De*
indicates that the correct information is being transferred to the query.

My problem is that although the results of the query are consistent when
the same dates are entered (as a test) and the results are different for
various entries, the results bear no resemblance to the query input and
are not returning records with a Date Found greater than the date
specified in the variable -1. The results include records with dates
before and after the specified date.

Any help with this would be appreciated. You can either post an answer on

Thanks.

Bruce Campbell

 
 
 

Date Tilde Variable in Query

Post by Terry Straehl » Wed, 12 Jun 1996 04:00:00



>Hi,
>I'm using PFW5.0 and have a date tilde variable in a query statement in
>OPAL. Input for this, and other, variables is obtained via a dlg box. The
>date is obtained in the format mm/dd/yy. But everywhere else in the
>system the user has insisted on date being in the format dd.mm.yy
>(Australian date format).
>The variable has been set up as:-
>var
>    LostDate     Date
>endvar
>In the query statement in the "Date Found" field I have the statement
>|Check >~(LostDate - 1)| . An inspection of variables with De*
>indicates that the correct information is being transferred to the query.
>My problem is that although the results of the query are consistent when
>the same dates are entered (as a test) and the results are different for
>various entries, the results bear no resemblance to the query input and
>are not returning records with a Date Found greater than the date
>specified in the variable -1. The results include records with dates
>before and after the specified date.

It is not clear from your post exactly what the problem is.  One thing
to remember is that items entered in unbound dialog boxes are strings,
not dates and have to be recast as dates.  The other might have to do
the the other representation, but your message leaves this unclear.
If youur client is entering in the format you showed you need to
convet that to the internal date format, probably by substituting "/"
for "." and casting as a date.

 Straehley Associates - Computer Consulting and Programming

 http://www.veryComputer.com/

 
 
 

Date Tilde Variable in Query

Post by Bob Barro » Thu, 13 Jun 1996 04:00:00



>Hi,
>I'm using PFW5.0 and have a date tilde variable in a query statement in
>OPAL. Input for this, and other, variables is obtained via a dlg box. The
>date is obtained in the format mm/dd/yy. But everywhere else in the
>system the user has insisted on date being in the format dd.mm.yy
>(Australian date format).
>The variable has been set up as:-
>var
>    LostDate     Date
>endvar
>In the query statement in the "Date Found" field I have the statement
>|Check >~(LostDate - 1)| . An inspection of variables with De*
>indicates that the correct information is being transferred to the query.
>My problem is that although the results of the query are consistent when
>the same dates are entered (as a test) and the results are different for
>various entries, the results bear no resemblance to the query input and
>are not returning records with a Date Found greater than the date
>specified in the variable -1. The results include records with dates
>before and after the specified date.
>Any help with this would be appreciated. You can either post an answer on

>Thanks.
>Bruce Campbell

Hi Bruce,
You should not use a date variable in a query statement. You will get
better results if you cast it to a string variable and use the string
variable in your query:

var
LostDate Date
strdate     String
endvar

strdate = string(LostDate - 1)

|Check > ~strdate   |

The readme.txt file in your pdoxwin directory mentions this.

Hope this helps
Bob Barrows