By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

Add formula to Data Report

P: 3
Hi Guys, I'm newbie in this forum,.. and i'm having trouble with Data Report.

I've been read about How to Create Dynamic Report (thanks to Creative1).
But now i have some other trouble (sorry about my English).

Here's the case:
1. I create a report for sales inventory, from two table Master_head an Mst_inv, heres the query
Expand|Select|Wrap|Line Numbers
  1.  SELECT I.`TANGGAL`, I.`PLU`, I.`Q_FIRST_I`, I.`Q_REC_I`, I.`Q_RET_I`, (I.`Q_KRP_I` - I.`Q_KRM_I`) As Koreksi, I.`Q_TRS_I`, I.`Q_STK_I`, MH.`DESCP` FROM `M_MST_INV` I INNER JOIN `MASTER_HEAD` MH ON I.`KD_STORE` =  MH.`KD_STORE` AND I.`PLU` = MH.`PLU` WHERE VAL(FORMAT(I.Tanggal,'YYYYMMDD')) >= & Val(Format(DTPicker1.Value, "yyyymmdd")) &  AND VAL(FORMAT(I.Tanggal,'YYYYMMDD'))<= & Val(Format(DTPicker2.Value, "yyyymmdd")) Order By I.`TANGGAL`, I.`PLU`
  2.  
2. Now I want to count differenc stock between first record and the second record, here's some algorithm:
Expand|Select|Wrap|Line Numbers
  1. If I.Q_FIRST_I <> I.Q_STK_I THEN
  2.        Difference_Stock=I.Q_STK_I - I.Q_FIRST_I
  3. ELSE
  4.        Difference_Stock=0
  5. Endif
  6.  
but i'm having trouble to use this formula in Data Report.
Could Some one help me? I know it's possible if use Template table, but this two table Contains Huge records, and i think it took A long time to get the result.

I hope some one could help me ASAP, or can send me and email to dsugihatna@gmail.com
Nov 23 '07 #1
Share this Question
Share on Google+
1 Reply


lotus18
100+
P: 866
Hi Guys, I'm newbie in this forum,.. and i'm having trouble with Data Report.

I've been read about How to Create Dynamic Report (thanks to Creative1).
But now i have some other trouble (sorry about my English).

Here's the case:
1. I create a report for sales inventory, from two table Master_head an Mst_inv, heres the query


Expand|Select|Wrap|Line Numbers
  1.  SELECT I.`TANGGAL`, I.`PLU`, I.`Q_FIRST_I`, I.`Q_REC_I`, I.`Q_RET_I`, (I.`Q_KRP_I` - I.`Q_KRM_I`) As Koreksi, I.`Q_TRS_I`, I.`Q_STK_I`, MH.`DESCP` FROM `M_MST_INV` I INNER JOIN `MASTER_HEAD` MH ON I.`KD_STORE` =  MH.`KD_STORE` AND I.`PLU` = MH.`PLU` WHERE VAL(FORMAT(I.Tanggal,'YYYYMMDD')) >= & Val(Format(DTPicker1.Value, "yyyymmdd")) &  AND VAL(FORMAT(I.Tanggal,'YYYYMMDD'))<= & Val(Format(DTPicker2.Value, "yyyymmdd")) Order By I.`TANGGAL`, I.`PLU`
  2.  
2. Now I want to count differenc stock between first record and the second record, here's some algorithm:
Expand|Select|Wrap|Line Numbers
  1. If I.Q_FIRST_I <> I.Q_STK_I THEN
  2.        Difference_Stock=I.Q_STK_I - I.Q_FIRST_I
  3. ELSE
  4.        Difference_Stock=0
  5. Endif
  6.  
but i'm having trouble to use this formula in Data Report.
Could Some one help me? I know it's possible if use Template table, but this two table Contains Huge records, and i think it took A long time to get the result.

I hope some one could help me ASAP, or can send me and email to dsugihatna@gmail.com
What probably will be the result if you use that formula? Are you using your formula during on the run time? Or it is defined on query on the database and retrieve it during run time?
Nov 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.