PDA

View Full Version : Convert() like function in Access SQL?



oracleguy
Aug 16th, 2004, 01:30 AM
I'm trying to convert a column from a number to a varchar-like column in a Access SQL query.


SELECT MSysObjects.Name, Convert(varchar,MSysObjects.Type) AS xtype, MSysObjects.DateCreate AS refdate FROM MSysObjects WHERE Type=5 OR Type=1 AND NOT Left(Name,4)='MSys'

The problem with this code is that apparently, that function doesn't exist with Access.

Additionally, I was just using the Replace() function in the query when I wrote the query in Access and it worked but it won't work from the outside using either the Access Driver or the Jet 4.0 Driver. So, since I couldn't do that, I was going to update the recordset after the fact but I can't do that until I get the field type to be something other than an integer.

Any ideas?

raf
Aug 23rd, 2004, 11:46 AM
so noone responds ...

i don't know the answer but was hoping that someone would step in because
i was wondering why you need the typeconversion. I mean, what's the difference in the recordset in the value comes from a string or numeric value?
why cant the fieldtype of the sourcevariable be an integer?

i remember from the past that there were post in the ASP forum (from glengv i believe) about typeconversions, but i can't remember why they were needed + can't seam to find them through the searchfucntion. :o

BuddhaMan
Aug 30th, 2004, 02:24 AM
Possible clues:

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21063602.html

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrcreatingmodifyingaccesstables.asp

quanou
Dec 23rd, 2005, 09:59 AM
str()