VB icon

FUNCTION: Return Astrology Sign By Birthday

Email
Submitted on: 1/6/2015 10:26:00 PM
By: snowboardr (from psc cd)  
Level: Beginner
User Rating: By 3 Users
Compatibility: ASP (Active Server Pages)
Views: 786
 
     Function: Returns someones astrology sign using their birthday in m/dd/yyyy or m/dd/yy format ie. 8/27/1983 -- > Virgo
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: FUNCTION: Return Astrology Sign By Birthday
' Description:Function: Returns someones astrology sign using their birthday in m/dd/yyyy or m/dd/yy format ie. 8/27/1983 -- > Virgo
' By: snowboardr (from psc cd)
'
' Inputs:A date value
8/27/1983
8/27/83
'**************************************

<% Option Explicit
'# By Jason H
'# Improvements, comments, or if you find it useful
'# let me know jason@vzio.com
'#
'# September 15, 2003
'#
'# Working example below
'# Response.Write(UserSign("8/27/2003"))
Function UserSign(sUserDate) 	
 	
	Dim sMonth
	Dim sDay
	'# Remove year
	sUserDate = Left(sUserDate,InstrRev(sUserDate,"/")-1)
	sMonth = CINT(Left(sUserDate,(Instr(sUserDate,"/")-1)))
	sDay = CINT(Replace(sUserDate, sMonth & "/", ""))
 	 
	 Select CASE sMonth			
				Case 1 
					If sDay => 20 then
							UserSign = "Aquarius" 
							 		ElseIf sDay <= 19 then
							UserSign = "Capricorn"
					End If
				Case 2
					If sDay <= 18 then
							UserSign = "Aquarius" 
								ElseIf sDay => 19 then
							UserSign = "Pisces"
					End If		
				Case 3
					If sDay <= 20 then
							UserSign = "Pisces"
								ElseIf sDay => 21 then
							UserSign = "Aries"
					End If
				Case 4 
					If sDay <= 19 then
							UserSign = "Aries"
								ElseIf sDay => 20 then
							UserSign = "Taurus"
					End If
				Case 5			
					If sDay <= 20 then
							UserSign = "Taurus"
								ElseIf sDay => 21 then
							UserSign = "Gemini"
					End If
				Case 6					
					If sDay <= 21 then
							UserSign = "Gemini"
								ElseIf sDay => 22 then
							UserSign = "Cancer"
					End If
				Case 7
					If sDay <= 22 then
							UserSign = "Cancer"
								ElseIf sDay => 23 then
							UserSign = "Leo"
					End If
				Case 8
					If sDay <= 22 then
							UserSign = "Leo"
								ElseIf sDay => 23 then
							UserSign = "Virgo"
					End If
				Case 9 								
					If sDay <= 22 then
							UserSign = "Virgo"
								ElseIf sDay => 23 then
							UserSign = "Libra"
					End If
				Case 10
					If sDay <= 22 then
							UserSign = "Libra"
								ElseIf sDay => 23 then
							UserSign = "Scorpio"
					End If
				Case 11
					If sDay <= 21 then
							UserSign = "Scorpio"
								ElseIf sDay => 22 then
							UserSign = "Sagittarius"
					End If	
				Case 12
					If sDay <= 21 then
							UserSign = "Sagittarius"
								ElseIf sDay => 22 then
							UserSign = "Capricorn"
					End If
	End Select
End Function
Response.Write(UserSign("8/27/2003"))
%>


Other 12 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.