SQL – Select using current day…

I’ve had this problem a few times, and many people always ask me it… so here it is immortalised.

If you require to select all records added to your table for the current day use the following where clause – obviously ‘col’ should be the name of your datetime column…

Hope this helps you all as much as it has myself!
select *
from mytable
where datediff(day,getdate(),col)=0 and col <= getdate()

Email – Multipart Email with HTML/Plaintext

It is often quite usefull to be able to send an email with HTML for those that can support it, and Plaintext, for those who do not.

There is how you can send a ‘multipart’ email with ColdFusion.

<cfmail from=”" to=”" subject=”">
<cfmailpart type=”text/plain”>
Plain text goes here
</cfmailpart>
<cfmailpart type=”text/html”>
HTML version goes here
</cfmailpart>
</cfmail>