Category Archives: Snippets

quick code tips for single elements, attributes, or details

Get last record inserted without primary key or id

Sometimes we need to get the last record inserted into the database. But if there is no primary key, date, or ID field to query we can use a temp table to return the results we need. Example: Table MY_CONTACTS … Continue reading

Posted in Code, Snippets, SQL | Comments Off on Get last record inserted without primary key or id

isNull

Occasionally a field is blank but we have to sometimes have to show a default value or a value from another field. SQL gives us a nice tag to use: isnull(field1, field2) as name or isnull(field1, ‘n/a’) as name or … Continue reading

Posted in Code, Coldfusion, Snippets, SQL | Comments Off on isNull

Coldfusion output value formats

a library of things I use regularly but can never find when I need them. I will add to it over time. #datetime(fieldname, “mm/dd/yyyy”)# #DOLLARFORMAT(fieldname)# Excel formatting: color alternating rows <tr bgcolor=”###iif(currentrow MOD 2,DE(‘ffffff’),DE(‘ffff99’))#”> number as text in excel <td … Continue reading

Posted in Code, Coldfusion, Snippets | Comments Off on Coldfusion output value formats

dumping form variables

Occasionally I need to see the form variables passed from the form to the next page. There are a couple of ways to do it depending on your needs. CFDump is probably the easiest and outputs the results to a … Continue reading

Posted in Code, Coldfusion, Snippets | Comments Off on dumping form variables

CSS3 – The vanishing shadow

Do you usually resort to Photoshop to create an image of text or object with a drop shadow, save it as a gif or png (and hope no-one is using IE6)? Or do you layer boxes within background boxes to … Continue reading

Posted in Code, CSS, Snippets | Comments Off on CSS3 – The vanishing shadow