Professional Web Applications Themes

Birthday day - Macromedia ColdFusion

Ok I have this query to find if someone b-day is in a month <CFIF #ParameterExists(BDayMonth)# is "Yes"> <CFSET BDayMonth = "#CreateODBCDateTime(BDayMonth)#"> <cfelse> <CFSET BDayMonth = "#CreateODBCDateTime(Now())#"> </CFIF> <CFQUERY Name="GetData" datasource="Datasource" > SELECT * FROM MyContacts Where 0 = 0 AND Month(Birthday) = #Month(BDayMonth)# Order By MyContactID </CFQUERY> So this will show me 30 people that have a b-day this month. I am trying to find out now how many people would have a b-day for just today? Is this possible?...

  1. #1

    Default Birthday day

    Ok I have this query to find if someone b-day is in a month


    <CFIF #ParameterExists(BDayMonth)# is "Yes">
    <CFSET BDayMonth = "#CreateODBCDateTime(BDayMonth)#">
    <cfelse>
    <CFSET BDayMonth = "#CreateODBCDateTime(Now())#">
    </CFIF>


    <CFQUERY Name="GetData" datasource="Datasource" >
    SELECT * FROM MyContacts
    Where 0 = 0
    AND Month(Birthday) = #Month(BDayMonth)#
    Order By MyContactID
    </CFQUERY>

    So this will show me 30 people that have a b-day this month. I am trying to
    find out now how many people would have a b-day for just today?

    Is this possible?

    mikey999 Guest

  2. #2

    Default Re: Birthday day

    Use this:

    <cfoutput query="GetData">
    <cfif Day(BirthDay) is Day(Now())>
    Happy Birthdays whoever
    <cfelse>
    Not Today..
    </cfif>
    </cfoutput>

    You may want to order it by Birthday instead of MyContactID.
    You could also include the Day() criteria in the SQL if all you want is
    today's.


    OldCFer Guest

Similar Threads

  1. Trying to Find Who's Birthday
    By Noyb in forum PHP Development
    Replies: 2
    Last Post: July 13th, 03:46 PM
  2. Happy Birthday Perl
    By Swaminathan Gopal in forum PERL Beginners
    Replies: 1
    Last Post: December 18th, 10:22 AM
  3. Happy Birthday Jodi
    By Pete D in forum Adobe Photoshop Elements
    Replies: 35
    Last Post: August 9th, 07:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139