Tag: SQL

The MIE Podcasts – Dick Kusleika

In the third MIE podcast I caught up with Dick Kusleika, father of the Excel blog and founder of the Dailiy Dose of Excel. We talked about his blog, his passion for the keyboard, SQL, ADO and DAO, amongst other things. Dicks sure is a nice guy, no matter what people say ;-).

Dick Kusleika, King of the Keyboard

Dick Kusleika, King of the Keyboard

Get the goodness here:

Please leave some comments with any feedback about this podcast, and also any ideas for future podcasts.

I’d also like to say a big thank you to the guys at Jellycast.com (Luke and NickM) for their help in getting the new hosting set up, great support guys.

Enjoy

VBA, SQL, Dates and Strings – the habits we form.

I’ve just built a dashboard with a bit of SQL. I’ve not done much for a while but I soon remembered that I have to pass dates very carefully.

SQL now accepts quite a lot of date formats, but as far as I know the American MM/DD/YY is still the standard of DAO? I think SQL server may now have YYYY/MM/DD as the standard.

Personally I always pass dates like this DD/MMM/YYYY, this work fine into an Access DB and that’s what I’ve always used.

I also notice that I tend to pass string variables like this

[CPP]
“HAVING (((tblWorkedTime.BDM)=” & Chr(34) & sPerson & Chr(34) & “)
[/CPP]

Why I don’t use a signal quote?

[CPP]
“HAVING (((tblWorkedTime.BDM)=’” & sPerson & “‘)”
[/CPP]

I don’t know, because I always pass “fixed” string that way very strange.

And then there’s the other thing with SQL code, why so some of use the:

[CPP]
sSQL = “SELECT………………………”
sSQL = sSQL & sSQL ” FROM………………………”
[/CPP]

While others use (the more natural?)

[CPP]
sSQL = “SELECT………………………” & _
” FROM………………………” & _
” WHERE………………………”
[/CPP]

Does anyone do differently? Are there any flaws in these (my) methods? I guess I picked these habits up because they where used in the books I read while I was learning them, but I don’t know if there really the best methods?