Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Tuesday, March 20, 2012

Current month date query

Hi,

I have a simple table called events, which lists the start and end dates of events. I'm using a calendar control that queries the db for events, but at the moment it does a check for every day by passing in the day. (Very inefficient)

What I'd like to do is pass in the current month, and get a set of rows that have an event which is in that month. It sounds easy, but I'm a little confused about what to do if the event starts current month -1 and ends currentmonth +1 I obviously need to return results like these also.

Do you just need something like this:

SELECT *FROM EventTableWHERE EventStartDate <= @.EndOfMonthOR EventEndDate >= @.StartOfMonth

You'll need to pass in the Start and End of Month values, of course. HTH

|||

I assume that you would like to return all events which started or finished in selected month. Maybe you can use Query like this if year is not important.

DECLARE @.tcMonth int

SET @.tcMonth=10 -- events for October

Select *

from Events

where MONTH(StartDate)=@.tcMonth

OR MONTH(EndDate)=@.tcMonth

Thanks

JPazgier

|||

That's great.

I changed the Or to an And though. :-)

|||

If you change OR to AND in this query you will receive only events which started and ended in selected month, with OR you should receive also events which were started earlier and finished in selected month and events which were started in selected month and finished after it.

Thanks

JPazgier

Monday, March 19, 2012

Currency Variables?

Starting in my control flow, I execute a data flow that populates a recordset via SQL 2005 Stored Proc. One of the columns in source table is a currency type.

Back to the control flow, I have a for each container that includes an execute sql task that updates or inserts records into another table. I get precision or data type issues since I can not assign the package variable to a currency data type. The only way I can get this to work is if I convert the currency column in my data flow to a string and then cast the variable in my update/insert sql task. Any suggestions?

Thanks....Gary

One suggestion would be to map the currency type in the recordset to a variable of type Object in the ForEach container's Variable mappings tab.

Then, when running the Execute SQL task in the ForEach container, use that Object variable in the parameter mapping tab with a DataType of CURRENCY.

No casting is needed.|||That works as described...Thanks!

Tuesday, February 14, 2012

crystalreportviewer in .NET different language?

When i show a report in a crystalreportviewer control,it appears those buttons,each with tool tips,also that "Main Report" text,can all this be modified ,to right something else?
for example in a aplication for countries that not use english,especially in europe,it should be all texts in different languages,so changing those texts.can this be modified?

Many thanks.Hi Jassie,

Did you solve that problem?

if yes, How?

I have the same problem,|||You may try this:

http://marian.ideaz.sk/crystal/