Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Friday, March 30, 2012

How can I convert DateTime to Date as Parameter?

Hi Guys! Need Help on this!! I am using a Datetime data type as my Parameter on my stored procedure in SQL Server 2005. I am also using Crystal Reports XI for my reporting using the stored procedure in SQL but my problem is that I want to use ONLY the DATE data type as my Parameter instead of using the datetime parameter in Crystal Reports! Since the SQL server does not have a Date data type, how can I convert this from DateTime to Only Date data type as my parameter?....Thanks!!

Use datatime data type and pass just date part from CR or strip off the time part wherever you are planning to use it.

declare @.d datetime

set @.d = getdate()

select dateadd(day, datediff(day, 0, @.d), 0)

go

AMB

|||

Thanks! but how do you pass just the date part from CR? Any idea would be greatly appreciated!! I can strip off the time part inside the stored procedure in SQL 2005 but CR is using the parameter which is datetime....

|||

Sorry about that, but I think that question could be answered better in a CR newsgroup. Try:

datetime(datepart("yyyy", {@.d}), datepart("m", {@.d}), datepart("d", {@.d}), 00, 00, 00)

AMB

|||Thanks AMB....that will work but that code is for the inside on the report...my problem lies in the parameter prompt window..how can I let the user only select the date without seeing the the time on the parameter prompt window?....|||

Sorry I have no idea. As I mentioned in my previos post, these questions would be better asked in a CR newsgroup.

AMB

Friday, March 23, 2012

how can i calculate "sum" in crystal report?

there is 2 field one is Branch code and second is transfer ammount.

if the branch code is same then the sum of transfer ammount is display

for eg

branch code transfer amount

0101 1000

0101 4000

--

5000

how can i do this?

Hi,

this forum is about reporting services only. If you want to do that in reporting service you would do a grouping per branch_code and do a sum in the footer of the group.

HTH, Jens Suessmeyer.


--
http://www.sqlserver2005.de
--

|||To be honest that's pretty much exactly what you'd also do in Crystal

Wednesday, March 21, 2012

How can i add a parameter in crystal report?

hi every body
How can i add a parameter in crystal report?
plz help me...
By RajeshThat can be dependent on which version you are using.

Wednesday, March 7, 2012

How a parent report access datafields in its subreport

I am converting a crystal report to SQL Server Reporting Services report. In my crystal report copy, I have a parent report which will pass three parameters to a subreport (the subreport will use the params to retrieve data from database), then the parent report needs to access a calculated data field in its subreport. How can I do this using SQL Server Reporting Services? The subreport doesn't share data with its parent in SQL Server Reporting Services, right? Thanks.

I've never tried to do this and it sounds pretty complicated. But I wonder if you code put code into the Code tab of the sub report, something like:

Public Function GetValue() As String
Return First(Fields!MyField.Value, "MyQueryName")
End Function

And then from the parent call:

MySubReport.Code.GetValue()

--------------------

This could be a terrible idea but if you're completely stuck it could be worth a shot.

|||

I've never tried to do this and it sounds pretty complicated. But I wonder if you code put code into the Code tab of the sub report, something like:

Public Function GetValue() As String
Return First(Fields!MyField.Value, "MyQueryName")
End Function

And then from the parent call:

MySubReport.Code.GetValue()

--------------------

This could be a terrible idea but if you're completely stuck it could be worth a shot.!