close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Date Format

Thread began 10/25/2010 6:37 am by nmabey414064 | Last modified 10/29/2010 7:57 am by Jason Byrnes | 3725 views | 9 replies |

nmabey414064

Date Format

Hi,

is it possible to use the chart in another date format than mm/dd/yyyy?

We are UK based and it would be ideal to send start end end date in dd/mm/yyyy.

Thanks for the help

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to edit the query created for the chart and use the MySQL Date_FORMAT command.


in the DynamicWebCharts/Data folder a file will be created named <pageName>_data1.php where <pageName> is the name of the page you applied the chart to.

this file has the recordset.


edit the recordset and add the DATE_FORMAT function around the date column:
DATE_FORMAT(dateColumn, '%d/%m/%Y')

Sign in to reply to this post

nmabey414064

I am using ASP in VBscript and in the <pageName>_data1.asp is no date format function.

Where can I find this function in asp/vb?

Thanks very much for quick reply

Sign in to reply to this post

Jason ByrnesWebAssist

in Access, it would be:
Format(dateColumn, 'dd/mm/YYYY')

Sign in to reply to this post

nmabey414064

Sorry that might sound stupid...

But in which document can I change this?

My MsAccess database is using dd/mm/yyyy. The Graph doesn't display when I am sending dates in dd/mm/yyyy they need to be mm/dd/yyyy.
My
name_data1.asp,
name_dataparser1.asp,
wa_dfc_xmlVB.asp
nor wa_dwc.dtd
has a format date section.

So where do I change the format?

Thanks very much for all the help, I am new to this all and somethimes you can't the wood for the trees.

Thanks for all the help

Sign in to reply to this post

Jason ByrnesWebAssist

  The Graph doesn't display when I am sending dates in dd/mm/yyyy  




ok this is the missing piece, how are you sending them in? through form? a query string?


can you sends a copy of the page that displays the graph and a copy of the data page, this may help me give you a better answer.

Sign in to reply to this post

nmabey414064

I think it is through a query string...


I Query FD (FirstDay) and LD (LastDays) on the previous page like this (I set <%session.lcid=1033%> on the top of the page, so that the date is created in the american way, otherwise the graph is not displayed):

dim LD
dim FD
dim todaydate
todaydate = Day(date)
if RSD > todaydate then
FD = DateSerial(Year(Date), Month(Date) -2, RSD)
LD = DateSerial(Year(Date), Month(Date) -1, RSD -1)
else
FD = DateSerial(Year(Date), Month(Date) -1, RSD)
LD = DateSerial(Year(Date), Month(Date) -0, RSD -1)
end if

and then I pass them through a link and the url to the next page that displays the graph.
The url look then like this:
.../protected2.asp?Site_ID=5&Site_Name=Site%202&AM=4361&FD=9/15/2010&LD=10/14/2010

The code for the graph on the page displaying it 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="200">
<param name="movie" value="DynamicWebCharts/open-flash-chart.swf?data=DynamicWebCharts/Data/protected2_dataparser1.asp?Site_ID=<%=Request.QueryString("Site_ID")%>%26FD=<%=Request.QueryString("FD")%>%26LD=<%=Request.QueryString("LD")%>" />
<param name="quality" value="high" />
<embed src="DynamicWebCharts/open-flash-chart.swf?data=DynamicWebCharts/Data/protected2_dataparser1.asp?Site_ID=<%=Request.QueryString("Site_ID")%>%26FD=<%=Request.QueryString("FD")%>%26LD=<%=Request.QueryString("LD")%>" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="940" height="200"></embed>
</object>

The code of the data page looks like this:

<%
Dim MM_Stats14_STRING
MM_Stats14_STRING = "dsn=Login;"
%>
<%
Dim WADWCStats__ParamSite_ID
WADWCStats__ParamSite_ID = "-1"
If (Request.QueryString("Site_ID") <> "") Then
WADWCStats__ParamSite_ID = Request.QueryString("Site_ID")
End If

Dim WADWCStats__ParamFistDay
WADWCStats__ParamFistDay = "-1"
If (Request.QueryString("FD") <> "") Then
WADWCStats__ParamFistDay = Request.QueryString("FD")
End If

Dim WADWCStats__ParamLastDay
WADWCStats__ParamLastDay = "-1"
If (Request.QueryString("LD") <> "") Then
WADWCStats__ParamLastDay = Request.QueryString("LD")
End If

Dim WADWCStats
Dim WADWCStats_cmd
Dim WADWCStats_numRows

Set WADWCStats_cmd = Server.CreateObject ("ADODB.Command")
WADWCStats_cmd.ActiveConnection = MM_Stats14_STRING
WADWCStats_cmd.CommandText = "SELECT Stats_Date AS XLABEL, Minutes AS YVALUE FROM Stats WHERE Site_ID = " & Request.QueryString("Site_ID") & " AND Stats_Date >= #" & Request.QueryString("FD") & "# AND Stats_Date <= #" & Request.QueryString("LD") & "# ORDER BY Stats_Date"
WADWCStats_cmd.Prepared = true

Set WADWCStats = WADWCStats_cmd.Execute
WADWCStats_numRows = 0
%>


Does that make sense, does this helps?

If I don't create the date in the american way and sent it in the uk way the graph doesn't display so I think I have to change somehow the way the graph wants to receive the date, but where?


Thanks very much for the help

Sign in to reply to this post

Jason ByrnesWebAssist

add this code to the page that has the chart on it:

<%
function switchMonthDay(theDate)
dim theMonth,theDay,theYear
theMonth = Left(theDate,inStr(theDate,"/")-1)
theYear = Right(theDate, Len(theDate) - inStrRev(theDate,"/"))
theDay = Mid(theDate,inStr(theDate,"/")+1, inStrRev(theDate,"/")-inStr(theDate,"/")-1)
switchMonthDay = theDay & " / " & theMonth & " / " & theYear
end Function
%>





then locate these two code blocks:
<%=Request.QueryString(" FD")%>
<%=Request.QueryString("LD")%>

and change them to:
<%=switchMonthDay(Request.QueryString(" FD"))%>
<%=switchMonthDay(Request.QueryString("LD"))%>

Sign in to reply to this post

nmabey414064

Thanks very much it works!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

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...