Crystal Reports Greater than or equal to parameter - crystal-reports

I am relatively new to Crystal Reports, I have created the report which is all working fine put I want to added to parameters. The first is Customer where the user selects or Customer they want to run the report on, which is working fine.
The second is Delivery date which is what I am stuck on. I want to create a report parameter so that when the user selects the delivery date that it shows all results from the selected date to the current date.
For example:
User selects 01/01/2014 for Customer X : the query should return all deliveries from 01/01/2014 to the current date for customer X.
Can anyone help?
Thanks in advance

Try this:
Create a Parameter Start Date with date datatype and in record selection formula write below code:
Assuming you have a date field in database:
tablename.date>={?Start Date} and tablename.date<CurrentDate

Related

how to get a data which is not entered in the specific date and also get the data which is entered in the specific date in tableau

I am creating a report for a retail shop in which i need to give a product in stock per day so i used the entry date as a parameter to filter the data but the problem here is the items which are not entry on that specific day is not coming on the report i need the report to be like
if parameter=entrydate then product in stock else preveious product in stock
i.e if the item is not entered in that particular date it should give the past record of it. how to get that please help me with this
Regards,
Jen

Search in specified date range, but only return the data with the latest date

When the user searches within selected date range parameter of the report, it should only return the data with the latest decision date (throughout the whole database, not just the selected date range).
For example, when the user search within the date range for the data below from 01/03/2016 to 01/07/2016, it should not return item 111. This is because the latest decision date of this item is 24/12/2016, which is not within the selected date range (from 01/03/2016 to 01/07/2016).
Item Code Decision Date
111 09/05/2016
111 24/12/2016
If the report does not have the search date range, I can group the report by item code, sort the data by decision date in desc order, and then move the data into the group header, it will always show the data with the latest decision date. But after I added the search date range parameter, it only return the latest date within the date range, not the whole database, and this is not what we wanted.
If you're able to use subreports, pass the Item Code as a parameter to a subreport which is used to calculate the latest decision date for that Item Code. Then you can pass the results as a Shared Variable.
In order to make this work, you'll need the subreport to appear in a section before the section that needs to use it. (It can be suppressed or hidden, as long as it's above.) So for example, if you intend to suppress the details section, your subreport will need to be in a header just above that. (You can make a dummy group for this if need be.)

Create a chart using the records of certain type grouped by month, with a moving balance

I am trying to create a chart (bar or line) in crystal from one table in my database (Sage CRM).
The records are as follows
CustomerId Date Invoice Amount
1234 3/4/2013 Cust Invoice 3322.00
1234 3/4/2013 Payment 2445.00
1234 4/5/2013 A/c transaction 322.00
1234 5/6/2013 interest 32.00
1234 6/6/2013 payment 643.00
So I would like to have a report that meets the following criteria
Only records for the last 12 months grouped in month
Only invoice types of payment, invoice and interest
A moving balance that calculates all the invoice amounts ie
(when displaying the information for July 2012, the moving balance will be the total of all invoices prior to this date.
Without this field I can create the chart no problem using select expert but I am not sure now what to do)
Should I use a cross tab? if so how will I do the selection to only show the invoices I want and the the date range I want?
After spending almost a week on this problem, with a lot of help from an expert I have finally got a solution.
In order to create a amount that is the sum of all records for a company, month and invoice type since the beginning of time, while only displaying records for the last year, I have created a SQL command
Select
//All of the fields for the report,
movingBalance.Amount
from myInvoiceTable as mit
<join to any other tables for the report>
left join (
select customerID, sum(amount) as Amount
from myInvoiceTable
where Record_Type in ('Payment', 'Invoice','Interest')
and Date < {?Report Start Date}
group by customerID) movingBalance
on mit.customerID = movingBalance.customerID
where mit.RecordType in ('Payment', 'Invoice','Interest')
and mit.Date >= {?Report Start Date}
and mit.Date <= {?Report End Date}
There are a couple of tricks to using commands:
For performance reasons you generally want to include ALL of the data for the report in a single command. Avoid joining multiple commands or joining one or more tables to a command.
Filter the data in the command, NOT in the Select Expert in the report.
Create any parameters in the Command Editor, not in the main report. Parameters created in the report won't work in the Command Editor.
This has done the trick.
Create Date Parameters in the report to filter out the records at the time of fetching now when you run the report you have left with the data you need.
Now you can manuplate the data inside report using formula fields.
Accoding to me writing stored procedures is a bit hectic task as you can manuplate the data inside the report. I don't have any intentions to disrespect anyone opinions but frankly its my opinion.
In that case Rachsherry I would recommend the following.
For criteria parts 1 & 2 I think instead of using stored procs, it may be easier for you to use a formula.
For invoices right click the invoice field, then "Format Field" in the common tab next to the Suppress option there is a formula button, enter the following...
IF {YourInvoiceField} IN ["Payment", "Invoice", "Interest] THEN FALSE ELSE TRUE
For your date requirement you need to use a selection formula... The code for that should look something like this
{YourDateHere} > DateAdd ("yyyy", -1, CurrentDate) AND {YourDateHere} < CurrentDate
The above code basically looks at dates between the day the report is run, and exactly a year before.
For your moving balance, you should be able to achive that with the guide here
Edit - An alternative to this is to use parameter fields (Which I don't personally like) it just means having to input the parameters every time the report is refreshed, they are self explanatory but you can find a guide here

Crystal Reports - Select Current YYMM

I'm trying to create a Crystal Report that reads data from an access table. I have a particular field in the access table called REPT_YYMM. This is basically a run data field, so each month when a program is run it populates the current year/month in the field before exporting to access, so there is a way to do month to month comparisons. For the report I'm working on I just want to display the data along with the current REPT_YYMM field when the data is refreshed on a monthly basis. Is there a way to do this in a formula. I'm not familiar enough with date type functions to know where to start.
Any guidance or suggestions are appreciated!
Your question isn't very clear but if i understood correct you just need to filter the data where field REPT_YYMM = YYMM.
Goto selection formulas, record and enter:
{table.REPT_YYMM} = cStr(currentdate,'yyMM');

Inserting Missing Dates into Crystal Report

I'm using Crystal Reports 10.
In my database I have production values for each Date. There's a date column and a qty column. When I run a report on this the dates on the report correspond to the dates in the database, but I'd like the report to display every date and if there is no value for it a 0. Is this possible to do right in the report?
The date is a group field with detail suppressed. The numeric values are a sum of the details placed in the group header, if that makes a difference.
You have 2 questions.
To display a 0 for null values, you can go into your options menu and "convert database NULL values to default"
Alternatively, you can use make a new formula with this code and use if isnull({Table1.Amount}) then 0 else {Table1.Amount}. I recommend this option since it won't affect other fields in the report.
To display every date, you should make a 'helper/index' table in your datasource and right-join your actual data to it. Crystal can't display data for, say, 01/07/2010 if there are no records for it.