Can't sum fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following expression in a query. The Normal LT and MaxTT fields
are both numerical fields from a table. I can multiply, subtract and divide
these two fields, but for some reason, when I try to sum them like below, it
concatenates them. For example; if Normal LT = 10 & MaxTT is 2 the query
result is 102. Any idea why? Not sure if it makes any difference, but
Normal LT & MaxTT fields are both created from expressions using Dlookup.

IPMatlToPODate: [Normal LT] + [MaxTT]

Thank you so much -
 
Try
IPMatlToPODate: Val([Normal LT]) + Val([MaxTT])

This is caused by the return type of DLookup().
 
Hi,
Not sure if this will help but you can try:
IPMatlToPODate: CLng([Normal LT]) + CLng([MaxTT])
 
cLng worked - thanks a bunch

Dan Artuso said:
Hi,
Not sure if this will help but you can try:
IPMatlToPODate: CLng([Normal LT]) + CLng([MaxTT])

--
HTH
-------
Dan Artuso, MVP


Alex said:
I have the following expression in a query. The Normal LT and MaxTT fields
are both numerical fields from a table. I can multiply, subtract and divide
these two fields, but for some reason, when I try to sum them like below, it
concatenates them. For example; if Normal LT = 10 & MaxTT is 2 the query
result is 102. Any idea why? Not sure if it makes any difference, but
Normal LT & MaxTT fields are both created from expressions using Dlookup.

IPMatlToPODate: [Normal LT] + [MaxTT]

Thank you so much -
 
Back
Top