Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2006, 11:21 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Day of week finder

Working on a cross tab display and need to find the day of week for a given DateTime variable in Classic ASP.
I am displaying 7 days and need to set the column by the day to insert a value.
Any one ever did this type of thing and used it?

Be excellent to each other...
 
Old May 12th, 2006, 11:41 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is a function named WeekDay.

In its simplest form you use can see it working like this:

Code:
<% response.write weekday(now) %>
This will return a number for the day of the week of the date you pass in. For example, for Friday, this would return 6.

I hope that helps

Woody Z http://www.learntoprogramnow.com
 
Old May 12th, 2006, 01:39 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think weekday is probably working, I am building an xml of the data and trying to set the column ID by the weekday.
It seems to ignore the statement
<col id="3"> and just insert the column as it is created.

Any ideas?


Be excellent to each other...
 
Old May 12th, 2006, 01:44 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not understanding what exactly you are asking.
Perhaps you can clarify this a bit?

Thanks

Woody Z http://www.learntoprogramnow.com
 
Old May 12th, 2006, 02:03 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I build the columns 0-8 and 2-8 are mon - sun.
I want to place the information from the aInbound array in the column under the correct weekday and leave the others blank.

Stream.WriteText " <col id="" & weekday(aInbound(1, llRowIndex)) & "">" & aInbound(2, llRowIndex) & "</col>" & vbCrLf

The result of aInbound(1, llRowIndex) is a date '02/12/2006 03:13:00'

Even if i replace that with a number '5' it still writes it to the 3rd column in on the page.

Any ideas?


Be excellent to each other...
 
Old May 12th, 2006, 03:18 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately, there seems to be insufficient information - or I am just not understanding.

As far as I understand it so far:
1 - You are using ASP, not ASP.NET
2 - You are writing some xml
3 - You are using an object named "Stream", which I am guessing is a TextStream object.

So... my questions:
1 - what are you actually doing with the XML once you have created it?
2 - Are you somehow are converting the xml to HTML? and if so, how are you doing this?
3 - Or... are you using the XML as a data island? or?

Regardless of what you put into the "col" element for the "id" attribute, this doens't mean anything to the browser. The id is just that, a unique identifier for that element. So, I have to assume you are doing something with the xml you are creating - so it is not the xml itself that is the problem, but rather how it is being processed once it is created.

Thanks


Woody Z http://www.learntoprogramnow.com
 
Old May 13th, 2006, 04:43 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You are correct the ID was just a marker for tracking, it didnt control the display order.
After talking with a few people here, I am getting the information formatted in a pivot table from the stored procedure and just displaying that result.
I appriciate your help.

Be excellent to each other...





Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the same day of the week. crabjoe Classic ASP Basics 3 February 27th, 2008 12:45 PM
DAY of the week wdepreter Excel VBA 3 February 7th, 2007 06:44 AM
Conversion to 7 day week. kinouye BOOK: Beginning VB.NET Databases 0 December 3rd, 2005 03:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.