Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSQRY32.EXE and Excel 1

Status
Not open for further replies.

Tve

Programmer
May 22, 2000
166
FR
Hi,

I'm trying to build a SQL statement to get Excel data.

The data is rather messed up, so I wanted to perform some cleanup within the SQL, but the SQL syntax for Excel is confusing me. I need functions, but I can't seem to find which functions are available: I'm used to the oracle functions: TO_CHAR, CONCAT, ....

Can anyone give me a hint?

Thanks

AD AUGUSTA PER ANGUSTA

Thierry
 


Hi,

To_Char(SomeDate, "yyyy/mm/dd")
can be replaced by
Format(SomeDate, "yyyy/mm/dd")

|| or CONCATENATE
use
&

SUBSTR(YourString,iFrom,iChrs)
use
Mid(YourString,iFrom,iChrs)

What else?


Skip,

[glasses] [red]Be Advised![/red] The only distinction between a bird with one wing and a bird with two, is merely...
a difference of A Pinion! [tongue]
 
Skip,

The commands appear to work (I just tried the MID).

Thanks a lot!

....but where do these come from? Are they Excel functions, as they are definately not SQL standard?


AD AUGUSTA PER ANGUSTA

Thierry
 


The are MS Functions, used in Access and Excel -- basically VB String functions.

Also, if you need to convert a CASE statement, you'll need to use IIF(expression,TRUE result,FALSE result)

Skip,

[glasses] [red]Be Advised![/red] The only distinction between a bird with one wing and a bird with two, is merely...
a difference of A Pinion! [tongue]
 
I noticed the two "II" in the iif. I'am assuming that this is not a typo....

But again, is there a list of MS functions I can use? Can I use the same functions with Excel, Access or CSV file?

By the way, I am not lazy, just sometimes fed up with all the different applicable syntax from one language to another, from one version to another, ... etc ... [morning]

AD AUGUSTA PER ANGUSTA

Thierry
 
Check the HELP files and/or
Skip,

[glasses] [red]Be Advised![/red] The only distinction between a bird with one wing and a bird with two, is merely...
a difference of A Pinion! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top