Click to See Complete Forum and Search --> : Getting the day of the date - how?


weee
04-24-2006, 05:35 PM
I entered the full date to my database: NOW() and I want to get the day out of the full date. How do I do it?

Thanks!

candelbc
04-24-2006, 05:37 PM
Like Day of the Week? Or just the Day?

For example:

4/24/06

Do you want just the 24, or Monday?

russell
04-24-2006, 06:13 PM
Use the DatePart (http://msdn.microsoft.com/library/en-us/script56/html/4e45cd84-b22b-437f-8410-6f4b8ff1c769.asp?frame=true) function

weee
04-24-2006, 07:17 PM
I want the Monday.

chrismartz
04-24-2006, 09:01 PM
take a look at http://www.w3schools.com/vbscript/func_datepart.asp

candelbc
04-24-2006, 09:43 PM
Here's another web site you might enjoy...

http://www.aspwebpro.com/aspscripts/dates/dayofweek.asp

weee
04-24-2006, 11:22 PM
It seems like I can't find a built in function that does the job....

Terrorke
04-25-2006, 02:10 AM
try something like this :

<HTML>
<HEAD><TITLE>Printer Friendly Page</TITLE></HEAD>
<BODY>

<%
DIM iDay
iDay = DatePart("w", Date())

SELECT CASE iDay
Case "1" strDayName = "Sunday"
Case "2" strDayName = "Monday"
Case "3" strDayName = "Tuesday"
Case "4" strDayName = "Wednesday"
Case "5" strDayName = "Thursday"
Case "6" strDayName = "Friday"
Case "7" strDayName = "Saturday"
END SELECT

Response.Write strDayName
%>

</BODY>
</HTML>

russell
04-25-2006, 02:15 AM
use the built-in WeekDayName (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/91ad6dd2-fd34-4777-a1d4-cca4421d18bf.asp) function

candelbc
04-25-2006, 08:44 AM
Dang it Russell.. I knew there was one.. I just never find myself using it... Nice memory!!

russell
04-25-2006, 04:37 PM
lol. yeah, i still got one or two old brain cells burnin' up there somehwere (barely) :)

candelbc
04-25-2006, 05:06 PM
Don't worry.. Your secret is safe with me!

weee
04-26-2006, 04:09 PM
Thanks!