Forums
This topic is locked
Show Dynamic text on Date
Posted 28 Jan 2006 18:30:52
1
has voted
28 Jan 2006 18:30:52 Christian Sen posted:
Hi,I want to extract info from a Db on certain dates. (Birthdays etc..)
How do I go about this?
Christian
Help is only a click away...
~~~~~~~~~~~~~~~~~
DWMX2004 | ASP | Access
Replies
Replied 30 Jan 2006 10:55:46
30 Jan 2006 10:55:46 Tom Theys replied:
In which way do you want to display it? Do you want to display the DOB date if it's today?
Replied 30 Jan 2006 16:44:29
30 Jan 2006 16:44:29 Christian Sen replied:
Just what I had in mind <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Help is only a click away...
~~~~~~~~~~~~~~~~~
DWMX2004 | ASP | Access
Help is only a click away...
~~~~~~~~~~~~~~~~~
DWMX2004 | ASP | Access
Replied 31 Jan 2006 13:41:11
31 Jan 2006 13:41:11 Tom Theys replied:
Try this code
<%
Dim strBirthNow
strDateNow = Now()
strBirthdayBoy= rsYourRecordset.Fields.Item("UserNameField".Value
strBirthNow = rsYourRecordset.Fields.Item("BirthdayDateField".Value
IF Month(strDateNow) = Month(strBirthNow) and Day(strDateNow) = Day(strBirthNow)
THEN %>
HAPPY BIRTHDAY !!! <% = strBirthdayBoy %>
<% else %>
It's nobody birthday today...
<% End If%>
You may also put this in a loop
Edited by - tothprod on 31 Jan 2006 13:42:58
<%
Dim strBirthNow
strDateNow = Now()
strBirthdayBoy= rsYourRecordset.Fields.Item("UserNameField".Value
strBirthNow = rsYourRecordset.Fields.Item("BirthdayDateField".Value
IF Month(strDateNow) = Month(strBirthNow) and Day(strDateNow) = Day(strBirthNow)
THEN %>
HAPPY BIRTHDAY !!! <% = strBirthdayBoy %>
<% else %>
It's nobody birthday today...
<% End If%>
You may also put this in a loop
Edited by - tothprod on 31 Jan 2006 13:42:58
Replied 31 Jan 2006 22:50:52
31 Jan 2006 22:50:52 Christian Sen replied:
Hi Tom,
Your script worked fine thank you, just one thing:
I only get up "It's nobody's birthday today...", but that might have to do with
the way we write dates in Europe (DD/MM/YYYY).
I tried to write the dates the other way (MM/DD/YYYY), but Access automatically
changes the values to European style. Maybe the script can't find a match because of this?
Any ideas?
Help is only a click away...
~~~~~~~~~~~~~~~~~
DWMX2004 | ASP | Access
Your script worked fine thank you, just one thing:
I only get up "It's nobody's birthday today...", but that might have to do with
the way we write dates in Europe (DD/MM/YYYY).
I tried to write the dates the other way (MM/DD/YYYY), but Access automatically
changes the values to European style. Maybe the script can't find a match because of this?
Any ideas?
Help is only a click away...
~~~~~~~~~~~~~~~~~
DWMX2004 | ASP | Access
Replied 01 Feb 2006 02:33:27
01 Feb 2006 02:33:27 Tom Theys replied:
hmm, you only check the day and the month, so the order doesn't mather.
Do you use any LCID on your page? And is the your date field a date type?
Do you use any LCID on your page? And is the your date field a date type?
Replied 01 Feb 2006 19:02:22
01 Feb 2006 19:02:22 Christian Sen replied:
Hm, I'm not sure about the LCID. If I am using it, it's not on purpose.
The date field is a date type.
Help is only a click away...
~~~~~~~~~~~~~~~~~
DWMX2004 | ASP | Access
The date field is a date type.
Help is only a click away...
~~~~~~~~~~~~~~~~~
DWMX2004 | ASP | Access