Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Help need on Date Calculation, Date Changed, 30/04/2006 to 30/12/1899

Dear All,

I am struggling with wrong date value.

Sceanrio

I am loading some data from the dBase III+ dbf files with the help of user DSN.

I want to add extra date type field to the table. For this I calculate a date with the help of under written statement


ak=date#(Peek('vDat',0,'tmpDate'));

enDate=monthend(MakeDate(year(ak),month(ak)))

enDate=30/04/2006

But as soon as I add this to the table date value changed to 30/12/1899 , here I am struggling what to to do I dont know.

I tried some thing but I am failled. I am using under written script in my QVW

ODBC CONNECT TO KLS;

tmpDate:

load *; SQL select max(VOU_DAT) as vDat from d:\Dos\Work\jour6 group by year(VOU_DAT),month(VOU_DAT);

ak=date#(Peek('vDat',0,'tmpDate'));

enDate=monthend(MakeDate(year(ak),month(ak)))

trn:

          load *, $(enDate) as trDate          ;

          SQL

          select * from (

                    select trCod,sum(amt1) as trAmt from (

                              select HED_COD as trCod, OP_BAL as amt1 from head6

                              union all

                              select HED_COD as trCod, sum(amt) as amt1 from jour6 where vou_Dat<=$(aks) group by HED_COD

                    ) as tb1 group by trCod

          ) as tb2 where trAmt<>0;

Please Help, Thanks In Advance

Regards

IndianQvLover

1 Solution

Accepted Solutions
MVP
MVP

Re: Help need on Date Calculation, Date Changed, 30/04/2006 to 30/12/1899

Try enclosing the date in single quotes (to avoid evaluating the division, resulting in zero -> 30/12/1899)

  load *, '$(enDate)' as trDate;

2 Replies
MVP
MVP

Re: Help need on Date Calculation, Date Changed, 30/04/2006 to 30/12/1899

Try enclosing the date in single quotes (to avoid evaluating the division, resulting in zero -> 30/12/1899)

  load *, '$(enDate)' as trDate;

Not applicable

Re: Help need on Date Calculation, Date Changed, 30/04/2006 to 30/12/1899

Swuehl Sir,

Thanks it is working, Thanks a lot and sorry to you mail.

Best Regards

- IndianQvLover

Community Browser