how to do data type conversions in access
From: Rance (ntg-rhall_at_nctc.net)
Date: 03/31/04
- Next message: Ryszard Gawron [MS]: "Re: Is it possible to revert from MDAC 2.8 RTM to MDAC 2.6 SP2?"
- Previous message: David Brockus: "Is it possible to revert from MDAC 2.8 RTM to MDAC 2.6 SP2?"
- Next in thread: Dmitri Ivanov: "Re: how to do data type conversions in access"
- Reply: Dmitri Ivanov: "Re: how to do data type conversions in access"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 31 Mar 2004 14:51:10 -0800
I have a column in a database called case_count, when the database was setup it was formatted as a charfield with 8 spaces, but the values should have been integers. so, what ever the number of cases the number is padded with enough extra zeros to make 8 chars (eg. '00000034' as opposed to 34)
what I need is the result of "SELECT sum(CASE_COUNT) FROM order_detal WHERE order_number='whatever'"
I know that this sql statement will return an error (because the char fields cant be summed)
inside Access I could so a sql statement and pipe the resulting strings into a recordset, and then do a
While (Not (rs.EOF))
do some stuff
rs.MoveNext
Wend
its the do some stuff part that I need help with
I need to save the string without its leading zeros (and I wont know how many there are)
and then convert the string to a number
then add the number to the counter
when Im done I should have a proper case count from the order
if anyone has a better approach than this, Im all ears.
P.S. if you can tell me how to trigger this VB procedure just prior to printing the report its for I would be even more greatful.
- Next message: Ryszard Gawron [MS]: "Re: Is it possible to revert from MDAC 2.8 RTM to MDAC 2.6 SP2?"
- Previous message: David Brockus: "Is it possible to revert from MDAC 2.8 RTM to MDAC 2.6 SP2?"
- Next in thread: Dmitri Ivanov: "Re: how to do data type conversions in access"
- Reply: Dmitri Ivanov: "Re: how to do data type conversions in access"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|