?
Solved

vbscript add day of week

Posted on 2006-05-26
4
Medium Priority
?
575 Views
Last Modified: 2012-05-05
I need to bug fix an asp page quickly.  I have a variable that is set as follows (hard coded to explain)

strDate = 27/05/2006

The following routine adding in strDate.........

<%=MediumDate2(DateAdd("d", intdaysno, strDate))%>

Gives

27-May

I need the output to be

Sat 27-May
0
Comment
Question by:EugeneC
4 Comments
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 16767812
Hello EugeneC,

> MediumDate2
you have to code it into the function. Without year you cannot get the day...

HTH

I
0
 

Author Comment

by:EugeneC
ID: 16767885
Example please?
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 16768339
I don't know what you are doing in your function but you need to format your date..

For example:

FormatDateTime(strDate, 1) would return:

Saturday May 27, 2006

Regards,
Max.
0
 
LVL 6

Accepted Solution

by:
BubbaisBest earned 2000 total points
ID: 16769111
Eugene C,

If you want it exactly like the Sat 27-May you will need to manually build

strNewDate = DateAdd("d", intdaysno, strDate)
strWeekdayName = WeekdayName(Weekday(strNewDate), true)
strMonthName = MonthName(month(strNewDate), true)
strDay = Day(strNewDate)

Response.Write strWeekdayName & " " & strDay & "-" & strMonthName

Bubs
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question