freelanceprogrammers.org Forum Index » Cold Fusion
Need help with a query!
Joined: 07 Jul 2005
Posts: 3
Need help with a query!
I am trying to come up with a query that will pull todays birthdays.
I am not too sure how I would do this. I have tried this:
<cfset today= #CreateODBCDate(NOW())#>
<cfquery name="birthday" datasource="project_tracker">
SELECT *
FROM email_pass
WHERE bday = #DateFormat(today , `mm/dd`)#
</cfquery>
However this doesn`t seem to work right. Any ideas?
Joined: 07 Jul 2005
Posts: 1
Need help with a query!
For this to work you need to substring out the portion for the database date that is the birthday -
in oracle - to_char( bday, "mm/dd" ). I am not sure what the syntax for the database you are using.
but what your current query is asking for will never give any results since 07/07/1968 with never equal 07/07.
>>> yellowledbetter@... 7/7/2005 8:56:19 AM >>>I am trying to come up with a query that will pull todays birthdays.I am not too sure how I would do this. I have tried this:<cfset today= #CreateODBCDate(NOW())#><cfquery name="birthday" datasource="project_tracker">SELECT *FROM email_passWHERE bday = #DateFormat(today , `mm/dd`)#</cfquery>However this doesn`t seem to work right. Any ideas?Yahoo! Groups Links<*> To visit your group on the web, go to: http://groups.yahoo.com/group/cold_fusion/<*> To unsubscribe from this group, send an email to: cold_fusion-unsubscribe@yahoogroups.com<*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
__________________________________________________
This message and any files transmitted with it are
intended for the sole use of the individual and
entity to whom it is addressed, and may contain
information that is privileged, confidential and
exempt from disclosure under applicable law. If
you are not the intended addressee, nor authorized
to receive for the intended addressee, you are hereby
notified that you may not use, copy, disclose or
distribute to anyone the message or any information
contained in the message. If you have received this
message in error, please immediately advise the
sender by reply email and delete the message.
Thank you very much.
Joined: 07 Jul 2005
Posts: 1
Need help with a query!
Try to do like this:
<cfquery name="birthday" datasource="project_tracker">SELECT *FROM email_passWHERE Day(bday) = #Day(now)# AND Month(bday) = #month(now())#</cfquery>
Regards,Marcos
----- Original Message -----
From: bushleaguer77
To: cold_fusion@yahoogroups.com
Sent: Thursday, July 07, 2005 2:56 PM
Subject: [cold_fusion] Need help with a query!
I am trying to come up with a query that will pull todays birthdays.I am not too sure how I would do this. I have tried this:<cfset today= #CreateODBCDate(NOW())#><cfquery name="birthday" datasource="project_tracker">SELECT *FROM email_passWHERE bday = #DateFormat(today , `mm/dd`)#</cfquery>However this doesn`t seem to work right. Any ideas?
Joined: 10 Sep 2002
Posts: 9
Need help with a query!
<cfquery name="birthday" datasource="project_tracker">
SELECT *
FROM email_pass
WHERE bday LIKE `#DateFormat(today , `mm/dd`)#%`
</cfquery>
----- Original Message -----
From: bushleaguer77 <yellowledbetter@...>
Date: Thursday, July 7, 2005 8:56 am
Subject: [cold_fusion] Need help with a query!
> I am trying to come up with a query that will pull todays birthdays.
> I am not too sure how I would do this. I have tried this:
>
> <cfset today= #CreateODBCDate(NOW())#>
>
> <cfquery name="birthday" datasource="project_tracker">
> SELECT *
> FROM email_pass
> WHERE bday = #DateFormat(today , `mm/dd`)#
> </cfquery>
>
> However this doesn`t seem to work right. Any ideas?
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
Joined: 07 Jul 2005
Posts: 3
Need help with a query!
Thank you, this works!!!
--- In cold_fusion@yahoogroups.com, "Marcos Placona"
<i_netmaster@h...> wrote:
> Try to do like this:
>
> <cfquery name="birthday" datasource="project_tracker">
> SELECT *
> FROM email_pass
> WHERE Day(bday) = #Day(now)# AND Month(bday) = #month(now())#
> </cfquery>
>
> Regards,
> Marcos
> ----- Original Message -----
> From: bushleaguer77
> To: cold_fusion@yahoogroups.com
> Sent: Thursday, July 07, 2005 2:56 PM
> Subject: [cold_fusion] Need help with a query!
>
>
> I am trying to come up with a query that will pull todays
birthdays.
> I am not too sure how I would do this. I have tried this:
>
> <cfset today= #CreateODBCDate(NOW())#>
>
> <cfquery name="birthday" datasource="project_tracker">
> SELECT *
> FROM email_pass
> WHERE bday = #DateFormat(today , `mm/dd`)#
> </cfquery>
>
> However this doesn`t seem to work right. Any ideas?
>
>
>
>
>
>
> -------------------------------------------------------------------
-----------
> YAHOO! GROUPS LINKS
>
> a.. Visit your group "cold_fusion" on the web.
>
> b.. To unsubscribe from this group, send an email to:
> cold_fusion-unsubscribe@yahoogroups.com
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms
of Service.
>
>
> -------------------------------------------------------------------
-----------
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







