Solved

Take User input in crystal

Posted on 2007-04-03
10
132 Views
Last Modified: 2010-04-30
Hi everyone,

I have a SQL query and i was working with the crystal by adding a command
but apparently it not giving me correct results in crystal
 here is the query

select  ph.txn_date_time as DATE_TIME,
        (select branch_desc from branch where branch_id = ph.branch_id) as Branch_Name,
      Pd.original_cp,
      pd.current_cp,
      pd.last_cp,
      psd.value,
      psd.vat_rate,
      psd.vat_value,
 psd.sold_value,
 psd.sku,
 pm.alt_code1 as Style,
      al.level1_desc,
      al.level2_desc,
      al.level3_desc,
      al.level_desc,
      al.level_desc_short



from    pm_trans_header ph,
        pm_trans_sku_details psd,
--        ss_users ssu,
        product_master pm,
        product_detail pd,
             anal_level al

where ph.receipt_id = psd.receipt_id
--and   psd.salesperson_id = ssu.id
and   psd.sku_id = pd.sku_id
and   pd.product_id = pm.prod_id
and   al.j_code = pm.j_code_link
and   al.level_no = 4
and   txn_date_time between '01-01-2007 00:00:00.000' and '27-01-2007 23:59:59.999'
and   (pm.alt_code1 like '41%' or pm.alt_code1 like '40%')
and   ph.flag = 1
and   ph.transaction_void = 0
and   psd.flag = 1
order by Branch_name,date_time


now when i cherry pick and put a new data in it gives wroong answer can some one help and let me know how to correct it?

Regards,
0
Comment
Question by:ammartahir1978
  • 5
  • 4
10 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 18843553
How are you putting new data in?  

Are you changing the where clause?

What happens if you refresh the report?

Check if you have data saved with the report.
open the report
Click FILE --> REPORT OPTIONS
Ensure SAVE DATA WITH REPORT is not checked

mlmcc
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 18843709
It would help if you would state what is wrong about the data.  The query, in general, looks fine.  Since I don't know what's wrong, however, I don't know what to look for.

~Kurt
0
 

Author Comment

by:ammartahir1978
ID: 18843772
i have unchecked it,

what  i want is the query i publish above is the query which gives me correct results in QUERY ANALYSER but when i run it in Crystall Report it gives like 8000 + pages which i dont understand as i am new to crystal, also how can i prompt to take date from user instead of hard coding it
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18844575
In Crystal

Display the FIELD INSERTION
Clcik PARAMETER
Click NEW (May have to right click)
Fill in the prompts
Name - StartDate
Type - Date

Repeat
Name - EndDate

In the REPORT --> SELECT EXPERT
Use a fromula
{txn_date_time} IN DateTime({?StarDate}, Time(0,0,0)) TO DateTime({?EndDate},Time(23,59,59))

mlmcc
0
 

Author Comment

by:ammartahir1978
ID: 18844632
hi Mlmcc

Thanks for this but i think you have to help me out in detail as i am very very new to crystal
dont even know where to get what i will really appreciate if you can guide me through step by step


Thanks a million


Regards,

Ammar Tahir
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 100

Expert Comment

by:mlmcc
ID: 18845844
Where is the trouble?  There really isn't more detail.

mlmcc
0
 

Author Comment

by:ammartahir1978
ID: 18881053
the details i am asking is the about the formula you told me above as where to put it.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 18882417
The selection formula?

CLick REPORT --> SELECT EXPERT
Click SHOW FORMULA
Click FORMULA EDITOR
Enter the formula - you can select the fields and parameters from the "trees"

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18917409
Glad i could help

mlmcc
0
 

Author Comment

by:ammartahir1978
ID: 18918160
you did thank you
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now