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 February 6th, 2004, 08:37 AM
Registered User
 
Join Date: Jan 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert to a number


Hi all,
I have been trying to solve the following problem but its seems to be that its not transfering the DayofWeek(Weekday(Now())) numeric value as a number but as a string. I have tried to convert into a number by ising CINT and CDbl but both don't seem to work. Does anyone have any ideas. The script sample is below.

 
Quote:
quote:
Quote:
DayNumberLoop = DayofWeek(Weekday(Now()))


                If InStr(strdata,DayofWeek(CINT(DayNumberLoop))) = 0 then
                    DayNumberLoop = DayNumberLoop+1
                    If DayNumberLoop > 7 then
                        DayNumberLoop = 1
                    End If
                End If
Thanks
Graham

Use you brain, not your brawn!
 
Old February 6th, 2004, 10:11 AM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you not simply decalre and integer variable and then assign the date value to this, eg intDate = Date()

 
Old February 6th, 2004, 11:46 AM
Registered User
 
Join Date: Jan 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi pab006,
What do you mean and How can I use it with my current script?
Thanks

Use you brain, not your brawn!
 
Old February 9th, 2004, 05:30 AM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry i misunderstood, what you where asking, what is this part of your code doing? If InStr(strdata,DayofWeek(CINT(DayNumberLoop))) = 0

I think this part of the code is probably the reason why it is returning a string, would it not be easier to simply test the DayNumberLoop ie if DAYNUMBERLOOP = 0 then ........

sorry for the misunderstanding

 
Old February 9th, 2004, 05:31 AM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, have you also tried simply printing out what value is given to to DayNumberLoop?






Similar Threads
Thread Thread Starter Forum Replies Last Post
convert time field to number jobalistic Access 17 February 22nd, 2013 12:40 PM
Validation For Phone Number and Mobile Number dhruthi.ram99 Javascript How-To 12 October 30th, 2011 07:24 AM
convert number into words on acces form superparim Wrox Book Feedback 0 September 19th, 2005 01:55 PM
Convert date to number samirz10 Access 1 July 22nd, 2005 03:04 PM
How can i convert english numbers to arabic number zahidpervaiz Classic ASP Databases 0 December 30th, 2003 06:51 AM





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