Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, this would then be something like:
..... &" TO_DATE(' " & Format(Dia,"DD/MM/YYYY HH24:MI:SS") &" ' ,'DD/MM/YYYY HH24:MI:SS')" & ........ This is very nasty stuff btw I would start with using *implicit* date conversion(my pervious mail), but that depends on the database platform and the conversion rules. This would then eliminate the TO_DATE function. coding a parameter inside an SQL string is *not* the most elegant way to do this BTW. Parameter binding works much better(and no conversion hassle). XL/MS Query can do this for you. My advice for complex queries in XL is normally around the lines of: Start with MS Query and make a simple query that works, but is probably too simple to be actually useful (e.g. a simple select) Then start adding your parameters in MS Query (like your date). to this simple query and see if it runs. For this you need to learn a bit of MS query, which is not the best of tools to use. After the query runs with parameters you want to convert in into an advanced query with this tool to edit a query directly in XL.to make it do what you want: http://homepages.paradise.net.nz/~ro...eryeditor.html By now the query should look OK and run in XL. If you still need extra stuff *then* you use VBA to manipulate the existing Query you made. DM Unseen |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problems with .Refresh BackgroundQuery:=False | Excel Worksheet Functions | |||
Refresh BackgroundQuery fails | Excel Programming | |||
Error on refresh backgroundquery - help please | Excel Programming | |||
Web query .Refresh BackgroundQuery:=False problem | Excel Programming | |||
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) | Excel Programming |