Showing posts with label wanna. Show all posts
Showing posts with label wanna. Show all posts

Wednesday, March 21, 2012

DateTime Problem

i'm having a web forum, i wanna make a page to show all today's posts, so for instance i tried to do this in the SQL statment:

Where Posts.DatePosted Between #09/20/2005# AND #09/22/2005#

but this erroe appeared to me:
Incorrect syntax near '#'
so can you please tell me better way and exact way to do this, thanx too much

That syntax is for Access. Your best bet is something like this:
Where Posts.DatePosted >= '20050920' ANDPosts.DatePosted < '20050923'

|||thanx too much it worked pretty fine, but i made it like this and its perfect:

HAVING MAX(Posts.DatePosted) >= '09/22/2005' AND MAX(Posts.DatePosted) < '09/23/2005'

Monday, March 19, 2012

DateTime parameter in report

Hi All:

I wanna have DateTime calendar filter in report, so i create a parameter call EndDate which defualt vavlue today, now i have problem how can i get the value from Date Time calendar after every time user selected new date, then i need to pass this date time value to subreport.

Thanks

Nick

Not sure I understand your request well. Are you asking how to pass a parameter value from a main report to a subreport? You may want to read the following BOL page: http://msdn2.microsoft.com/en-us/library/aa337167.aspx. In particular, you can pass parameter values to subreports by editing the subreport properties in the main report and setting the parameter expression to =Parameters!EndDate.Value

-- Robert

|||

hi Robert.

Thanks for your reply, now i got another error after i set up the date time parameter in subreports.

In the property of sub report , i use =Parameters!WeekEnding.Value, weekEnding is date time type parameter both in main and sub report.

now i run the report. i got error like below:

An error occured during local report processing. The value provided for the report parameter "WeekEnding" is not valid for it's type.

I have no ideas about this error message. it works fine if i change WeekEnding type to string both in main and sub report. is that anything i missing out here?

thanks

Nick