close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Start and end date ???

Thread began 10/11/2010 8:44 am by nmabey414064 | Last modified 10/14/2010 12:43 pm by Dani Chankhour | 2394 views | 8 replies |

nmabey414064

Start and end date ???

The graph is displayed but there are no bars displayed. The tootlip only says "undefined".
I am connecting to a MSAccess database. The code looks like this:

Set WADWCStats_cmd = Server.CreateObject ("ADODB.Command")
WADWCStats_cmd.ActiveConnection = MM_diagramm9_STRING
WADWCStats_cmd.CommandText = "SELECT Stats_Date AS XLABEL, Stats_Date AS YVALUE FROM Stats WHERE Stats_Date >= #07-July-2010# AND Stats_Date <= #14-July-2010#"
WADWCStats_cmd.Prepared = true

Is there any SQL Date Problem using VB and MSAccess?

Can the dates also be set dynamic? eg. the customer choose dates with a datepicker or they are forwarded through input fields?

Thanks a lot, please be patient I am new to this all!

Sign in to reply to this post

nmabey414064

The chart is working now with set start and end date.

Can these dates also passed dynamic? e.g. a user picks dates with datepicker and than they are passed to the chart?

Thanks a lot for all the help

Sign in to reply to this post

Dani Chankhour

yes. you can pass the dates dynamically using the date picker, you will just need to make sure it is passing the right date format.

Sign in to reply to this post

nmabey414064

gone dranock

Thanks you for your reply.

But how?

My Query with manually picked dates (in the wizzard) reads:
"SELECT Date AS XLABEL, Minutes AS YVALUE FROM Stats WHERE ID= ? AND Date >= #07-09-2010# AND Date <= #07-12-2010#"

Now I would like to replace #07-09-2010# and #07-12-2010# with the values(variable) in the url (mysite2.asp?ID=4&StartDate=10-14-2010&EndDate=10-23-2010)
for StartDate and EndDate. These variable are passed into the url from a form (on prevoius page (.../mysite1.asp)).


I though of something like this:

Dim WADWC__ParamStartDate
WADWC__ParamStartDate = Request.QueryString("StartDate")
Dim WADWC__ParamEndDate
WADWC__ParamEndDate = Request.QueryString("EndDate")

SELECT Date AS XLABEL, Minutes AS YVALUE FROM Stats WHERE ID = ? AND Date >= @WADWC__ParamStartDate AND Date <= @WADWC__ParamEndDate "


But It doesn't work like this. Thanks for all your help!

Sign in to reply to this post

nmabey414064

sorry just seen that the url doesn't show right...
url reads (.../mysite2.asp?ID=4&StartDate=10-14-2010&EndDate=10-23-2010)

Sign in to reply to this post

nmabey414064

Hi,
I have read that the when I want to create a string, I must enclose the date in hashes so my next attempt looked like this:

Setting the variable like the wizzard is doing for the for other variables
(e.g. the ID when I filter by URL):
<%
Dim WADWC__ParamStartDate
WADWC__ParamStartDate = "-1"
If (Request.QueryString("StartDate") <> "") Then
WADWC__ParamStartDate = Request.QueryString("StartDate")
End If
%>
and then the query:
<%
Set WADWC_cmd = Server.CreateObject ("ADODB.Command")
WADWC_cmd.ActiveConnection = MM_Calendar6_STRING
WADWC_cmd.CommandText = "SELECT Date AS XLABEL, Minutes AS YVALUE FROM Stats WHERE Site_ID = ? AND Date = #" & WADWC__ParamStartDate & "#"
WADWC_cmd.Prepared = true
WADWC_cmd.Parameters.Append WADWC_cmd.CreateParameter("param1", 5, 1, -1, WADWC__ParamSite_ID)
%>

Sadly this doesn't work? WHy? Where am I doing the mistake?

Thanks for the help

Sign in to reply to this post

nmabey414064

The chart works when I wether send an ID or a date but not both...


The URL reads:
.../page2.asp?ID=5&StartDate=07-12-2010&EndDate=07-15-2010

and I get the error:
DynamicWebCharts/Data/page2_dataparser1.asp?ID=5

for some reason I have the feeling the graph should receive both ID and StartDate and not only the ID as the error message suggests.

The object that is created by the wizzard is:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="940" height="300">
<param name="movie" value="DynamicWebCharts/open-flash-chart.swf?data=DynamicWebCharts/Data/page2_dataparser1.asp?<%=Request.QueryString()%>" />
<param name="quality" value="high" />
<embed src="DynamicWebCharts/open-flash-chart.swf?data=DynamicWebCharts/Data/page2_dataparser1.asp?<%=Request.QueryString()%>" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="940" height="300"></embed>
</object>

and I think here is the mistake.

When I replace <%=Request.Querystring()%>
with:<%=Request.Querystring("ID")%>
the chart receives the ID and displays.

When I replace <%=Request.Querystring()%>
with:<%=Request.Querystring("StartDate")%>
the chart receives the StartDate and displays.


But how do I pass both variables to the chart?
Do I have to change something in the <object> bid? What?



Thanks a lot and sorry that I put more and more questions up here but I thought it might be better to understand my problem.

Sign in to reply to this post

nmabey414064

FINALLY IT WORKS!

the mistake was in the <object> bid.

I tried to connect the different variables with an "&" sign. But when passing variables from html to flash via Query String I need to use "%26" istead of the "&". How should you know that :).

I am sorry for posting and posting my thoughts here, but maybe it will also help somebody else.

Thanks

Sign in to reply to this post

Dani Chankhour

I'm glad you got it to work.

sorry i was not able to help you out with this issue since I'm not that familiar with ASP.

Again, thanks for posting your solution.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...