Home > Geeky stuff > Note to self

Note to self

Note to self when converting mssql querys to mysql querys in ASP these are you friends,

dateFormat function for asp converts asp date fomat mm/dd/yyyy to mysql yyyymmdd

function convertDate(varDate)
dim dd, mm
if day(varDate) < 10 then
dd = "0" & day(varDate)
dd = day(varDate)
end if

if month(varDate) < 10 then
mm = "0" & month(varDate)
mm = month(varDate)
end if

convertDate = year(varDate) & mm & dd
end function

mysql query to return asp date format from select
select date_format(date, ‘%m/%d/%Y’) as date from tableName;

return two fields as concateded string in sql field
select concat(lastName,’, ‘, firstName’) AS wholeName from tableName

Categories: Geeky stuff
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: