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!

Data conversion errors in update query 1

Status
Not open for further replies.

vba317

Programmer
Mar 5, 2009
708
US
I am working in an access 2003 table. I have a field of data called MonDesc that is formatted as a string. The field has the month and year combined as one number. ex. 082010. I added another field called MonOnlyDesc that is formatted as a number. I am trying to run an update query that extracts the month from the field MonDesc and adds to to the field MonOnlyDesc. I get a dataconversion error when I do the update. Any help would be appreciated.

Code:
'Query in SQL view

UPDATE DICT_ImpMonList SET DICT_ImpMonList.MonOnlyDesc = Int(Left([MonDesc],3));
 
What about this ?
UPDATE DICT_ImpMonList SET MonOnlyDesc = Val(Left(Trim(Nz(MonDesc "00")),2))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry for the typo: missing comma inside the Nz function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
No problem, I fixed it without thinking about it. Your help is so greatly appreciated that I didn't want to bother you with that.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top