Date parameter in Crystal
Hi Experts,
I have a client who wants to add a from and to date in the parameter of a Invoice Crystal report.
Here is the Parameters I have:
{OINV.DocStatus} = "O" and
{OCRD.CardName} = {?Customers@SELECT DISTINCT T0.[CardName] FROM OINV T0 WHERE T0.DocStatus = 'O' ORDER BY T0.[CardName]} and
{OINV.DocNum} >= {?BeginDate@Select T0.[DocNum] FROM OINV} and
{OINV.DocNum} <= {?EndDate@Select T0.[DocNum] FROM OINV}
I added the OINV.DocNum, but get errors with this.
How can I get a from and to date on the OINV.DocNum field in this crystal report?
Thanks,
Marli
Gordon,
Thanks.
When I enter this in the Formula workshop I get the error 'There is an error in this formula. Do you want to save it anyway?', then another error 'This field name is not known.'
Here is the full query: (I only add the OINV.DocDate part)
{OINV.DocStatus} = "O" and
{OCRD.CardName} = {?Customers@SELECT DISTINCT T0.[CardName] FROM OINV T0 WHERE T0.DocStatus = 'O' ORDER BY T0.[CardName]} and
{OINV.DocDate} >= {?BeginDate@Select T0.[DocDate] FROM OINV T0} and
{OINV.DocDate} <= {?EndDate@Select T0.[DocDate] FROM OINV T0}
Thanks for your help.
Marli
Similar Messages
-
Defining Date Parameter In Crystal XI R2
Hi,
I have a simple Crystal report using basic select query from Oracle DB. I have added date prompts start date and end date for users to provide date range.
Date parameters are defined as : Type - Date, Static LOV
Allow custom values - true
Allow multile values - false
Allow discrete values - true
My problem is when I run the report
1) the date prompt asks the user to enter the format in which they want to enter date.. which appears as drop down box with only one option mm/dd/yyyy --- I dont want this to appear at all
To enter value Calendar appears which is ok with me.
2) If I change
Allow custom values - false
the prompt to enter format of date doesnot appear, however the prompt to enter date value has drop down list..with no calendar to it.
Please help!Hi,
The 'Allow Custom Values' option for a date parameter is set to true by default and cannot be changed unless a 'Value Field' has been set to load the date values from the database.
You've also mentioned that the date prompt has an associated List of Values? If this is true, then this is how Crystal behaves!
Once the 'Allow Custom Values' option has been set to false, it means the only option the user is left with, is to select one or more values from the drop-down. Another important thing is that, you cannot set the 'Allow Custom Values' to true and have the date prompt (With an associated LOV) appear ONLY with the Calendar button.
If all that you want is the Calendar button with no drop-down containing date values, just select 'None' in the 'Value Field' of the date parameter.
Have a great day!
-Abhilash -
Select Date Parameter in Crystal Report
Select fields Customer number ,Part code, transaction date, and sales amount from a table by month for a report . Report to run LastFullMonth.
However, need to include a date that lists the first time a customer bought the part previous to and including the LastFullMonth.
The date field in the table includes all transaction dates.
Can this be done on the same report?Add an SQL Command something like (MS SQL):
select customer, part, min(salesdate) as FirstSale
from invoice_detail
group by customer, part
and link it to the other tables in your query.
HTH,
Carl -
Crystal Reports Date Parameter Problem
Hello Experts,
I have this query in crystal, I need it to be suming the Quantity and Totals but because of the date optional its not doing that, How I put the date parameter and remove it from her so that I can achieve my results.
SELECT T0.[DocDate],T1.[Dscription] as 'BRANDS /SKU', Sum(T1.[Quantity]) as 'QTY', Sum(T1.[LineTotal]) as 'VALUE' FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode WHERE T2.[GroupCode] = '100' GROUP BY T1.[Dscription],T0.[DocDate]
Thanks,
TitiHi Titi,
I don't really get what your question is but I can suggest to add the date parameter on WHERE clause. In case it's optional, you can put validation checking before entering query. When it's null you set a period of time which is relevant to current date. And as replied by GordonDu, the parameter is compare to T0.DocDate
Hope it helps. -
Optional Prompt for Date type parameter in Crystal Report.
Hi Every One,
I have a date type parameter in crystal report.When I am convert it to optional prompt it is showing following message.
But the Type field is gray out when I was selecting list of values Dynamic.
Please suggest.
Thanks and Regards
DEVHi,
Please check SAP note:
1710595 - CR_Defining "Optional Prompt" as True for SAP Crystal
Reports Does Not Work
Thanks & Regards,
Nagarajan -
Crystal Reports Date Parameter Default Value OPtion Empty
Is there a way to set a default date value for a Date Parameter? It is shown empty, it only allows to set a fixed date, i.e. 10/10/2013. But it doesn´t allow me to use a formula (which has a CurrentDate inside), so I can set, for example, today's date as default.
How can I achieve this? I´m not using Crystal for Enterprise. I'm using Crystal Reports, the normal version.Hi Erika,
The feature is only available in CR for Enterprise at the moment.
If you're OK with selecting the currentdate from the dropdown, here's a workaround:
1) Go to the Database Expert > Click the Connection Name > Select 'Add Command' > Type in a simple sql query that returns today's date. Example for oracle would be:
Select SYSDATE from DUAL
2) Don't link this Command Object with other tables on the report
3) Create a new Parameter > Select 'Dynamic' under 'List of Values' > Under the 'Value' column choose 'SYSDATE' from the command object > Click create parameter > OK
-Abhilash -
How to make Start Date as optional parameter in Crystal reports 2011
Hi All,
I have existing Start Date and End Date parameter how to make them as optional parameters.
Thanks for your help in advance!!.Hi Mnnica,
There is an option 'Optional Prompt' under value options, make that as true. Do the same for both startdate and enddate then go in Record Selection Formula and write below formula :
If Not (hasvalue({?Startdate}) then True else {?Startdate} >= {databasedatefield}
and
If Not (hasvalue({?Enddate}) then True else {?Enddate} <= {databasedatefield}
Check below screen capture for Optional Prompt options :
-Sastry -
Adding date as runtime parameter in crystal report
Post Author: priyanair
CA Forum: General
Hi,
I have a report in which iam passing four runtime parameters. One of the parameter is date. my report is taking the date parameter as mandatory and if i leave it blank it doesn't show any output. If i fill in the date parameter it gives me the output corresponding to date. It ignores the other 3 parameter values. What could be the reason and what could be the possible solution for the same?
Please help.
Thanks
PriyaPost Author: priyanair
CA Forum: General
Hi,
This is the statement that iam using for assigning the parameter values to the database fields.
{Account.Name} = {?Name} or {Account.BillingCity} = {?City} or{Account.Type} = {?Type of customer} or{Account.LastModifiedDate} = {?Last Modified Date}
the last statement is my date parameter.
Thanks
Priya -
Sap function used in crystal- date parameter issue
have a function developed in sap and it is using date parameters in the function
i can run the function in sap and retrieve records
when i create a report from the function and create my date parameter to use in the record selection
and i enter my parameter values to run the report, it doenst retrieve any records
i have hardcoded dates
i am using this in the record selection
if hasvalue({?Run Date}) then {?Run Date} else currentdate
any ideas?Actually, what are you returning? In your record selection, what date are you trying to filter? Set your formula equal to whatever you want to return in the report:
if (not hasvalue({?Run Date})) then REPORT FIELD = currentdate else REPORT FIELD = {?Run Date} -
Getting Error with date parameter field -"Invalid DATE"
Hi
I created a report with 9.2 version. And i created 2 date parameter fields in it. And within crystal reports it works fine.
But If, I call from the VS2005 crystalreport.net(report document) SDK , i am getting error as Invalid Date" enter a Date Value". Actually it is a dtp control. how can i modify it.<p>There's not enough details to get a good understanding of your scenario, but it sounds like you're using some kind of date control to retrieve the date value and pass it to the report's parameter field at runtime. </p><p>If this is correct, it sounds like the format of the date value from the control may not be what the report is expecting. To debug, I would first use hardcoded values when you set the report parameter fields to see what works. Then compare that to what the return value is from the control to see if they match. I suspect the formats differ. </p><p>I did a quick search on the BOBJ kbase and found a couple of articles that may help you. I recommend searching as there are lots of information on how to set parameter fields at runtime. </p><p><span style="margin-left: 5px"><a href="http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2010247&sliceId=&dialogID=8582434&stateId=1 0 8584068" target="_blank">c2010247</a></span><span style="margin-left: 5px"><span style="margin-left: 5px"><a href="http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2010251&sliceId=&dialogID=8582434&stateId=1 0 8584068" target="_blank">c2010251</a></span></span></p><p>-MJ</p>
-
Optional Parameter in Crystal Report XI designer
Hi,
Is there a way to have parameter as optional in Crystal Reports XI ?
I am okay to have the parameter shown but I dont want it to be mandatory.In CR XI the only way to make a parameter optional is to assign it a default value.
For example:
If it is a date range parameter then give the date range parameter a default value say '1900-01-01'. Set this by editing the parameter and clicking on 'Default Value' in the options section.
Then, in your selection criteria have logic similar to this.
If minimum({?date parameter}) = date(1900,01,01)
and minimum({?date parameter}) = maximum({?date parameter}) then
{database.date} = {database.date}
else
{database.date} in {?date parameter};
If the users do not change the default value for the date range then it will pick up all records otherwise limited to the date range.
If it is a numeric parameter then assign a value of zero and for string perhaps 'z' (make sure the default value will never be equal to a DB value) and then in the selection criteria use:
If {?parameter} = 'z' then {database.field} = {database.field}
else
{database.field} = {?parameter}; -
CRS 2008 Web Services: Date parameter format issue
Hi All,
I have CRS 2008 installations (Dev environment and TEST environment) on two machine (both are on the build 12.1.0.882). I have a web application that runs crystal reports deployed to these servers using web services. On the DEV Server , the report works fine when the reports input parameters are formatted to mm/dd/yyyy format. But TEST server (which is a new installation) does not accept a date parameter value for this report in this format and returns a "could not set date parameter" error. The report runs fine if I pass the parameter in yyyy/dd/dd format from the web-application.
I compared the regional language settings and Business Objects registry entries on both these machines, CMC settings, and they all seem to match. Am I missing something in the configuration or environment setup that is causing this issue? Appreciate any hints on solving this issue. Thanks so much.
Regards
AjithHi Siva,
may i know how to do it?
as i did try to code in the begining by using String for my startDate and endDate. and it is able to consume, but currently if i change the startDate and endDate to Date. it is still able to consume when i change the date from "2008-01-30T10:00:50.342Z" to just "2008-01-30". but when i try to use adobe interactive form. the startDate and endDate i am using the Date/Time Field Type. and the Data Format is as Date. so it will just return "2008-01-30" only.
the part where i have error is when i try to do a parameter mapping from the interactive form to the web service. it is unable to map as they keep prompting that cannot map a Date to a Time Stamp.
that is why i stuck at this part.. so i try to find out how to overcome this errors now..
Regards
Jia Jun -
Passing input Dates in a Crystal Report
Post Author: Preethig
CA Forum: Older Products
Hi all,
I am using Crystal reports 8.5 to develop my report. I use the the Crystal report Enterprise Version 8.0 to view my reports in the IE 6.0 Web browser.I communicate to the Crystal Enterprise through my Active Server Pages.(ASP 3.0)
From my asp page redirect to the urlI use response.redirect
Here is an example URL:
http://Domain/Directory/Report.rpt?&prompt0=Valuemy url request is
Response.Redirect("report.rpt?&prompt0=" & some random value & "&prompt1=" & DateField & "&prompt2 =" & DateField )
and I use "sf " query string parameter for passing new selection criteria
There are three parametes defined in the Crystal report
Prompt0 - To accept a Number
Prompt1 - To accept a Date
Prompt2 - To accept a Date
Problem: Even after passing the input date parameters as the parameter values for the parameter "Prompt1" and "Prompt2" in my Active Server Page, on launch of the Crystal report in the Crystal enterprise Viewer, the Crystal reports' Dialog still prompts the user to give input dates.
Need Solution for: I should be able to pass the date parameter values from the ASP page and susequently, the crystal dialog should not be prompted to get the input dates.Kindly suggest a solution.
Thanks in advance!!PreethiWell, can you please post the details about your stored proc?
<quote> I've checked that when calling one stored-procedure within a crystal report, one sequence will be selected for 2 times. Thus 2 will be added to the corr. sequence No.</quote>
Question: What do you mean by that? How many times did you run the report?
More details please.
-Raj Suchak
[email protected] -
Post Author: RLCrist
CA Forum: General
Is there a way to have the date parameter on a report actually print on the report itself? For example, if my paramater is 2008-1-1 through 2008-1-2, I'd like that to show up on the report.
Any help would be appreciated.
R~Post Author: Crystal Fire
CA Forum: General
Write this formula and put it in the report header header.
You can change the text to whatever you need. I hope this helps.
"All Dates Between "+ ToText(Minimum({? DATE}),"M/d/yyyy")" and "ToText(Maximum({?DATE}),"M/d/yyyy") -
In my scenario, I have a main report and a sub report. I gave the date parameter in the sub report. I included sub report in the report footer of the main report. When I run the report it prompts the parameter to enter the date. Once after entering the date in the parameter it shows the main report and the sub report with details for that chosen date. My question is there any way in crystal reports 2008 when I run the report it should show the main report first and if I need to see the subreport then it should prompt me with a date parameter to see the details in the subreport for that chosen date. I appreciate your help.
Thanks,
Sukumar Reddyreddy
right click the subreport select the format subreport in the format editor select subreport tab , check the on-demand subreport option
right click subreport-> Format subreport-> in format editor select subreport tab-> check the on-demand subreport option
and click ok
in file report option uncheck the save data with report
Hope this works
thanks
krishnan
Maybe you are looking for
-
Consignment and non consignment material
Hi All, I need to understand and need help on below situation I have Material A with below scenarios Supplier 1 supplies it on Consignment Supplier 2 supplies it on Non-Consignment Is it possible to have this scenario,can we setup in th
-
How to update older pdfs to work with Adobe X
We have documents posted on a website and use a href link (html) to open pdfs to specific sections of the pdf which are highlighted. These pdf's were created with QuarkExpress and Acrobat Distiller 7.0 and do not work properly with Adobe X. It ap
-
Setting bpel variable using external java code
Hi all I would like to ask if there is a way to set bpel process variable during process execution from external java code using java api without using java embedding code?!! Thnx in advance
-
Here's the message I get: "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: file:///Applications/Firefox.app/Contents/MacOS/components/n
-
I am thinking about purchasing a new MacBook Pro here soon which I will be using for some processor and graohics intensive stuff. I am wondering which one is more powerful, the baseline 13 inch MacBook Pro with Retina Display or the baseline MacBook