Need Help with a qry.sql statement

  • Thread starter Thread starter Tiffer
  • Start date Start date
T

Tiffer

Guest
Need some help trying to diagnose a problem I'm experiencing. I'm using a qry.sql in a module to pull back some data through an ODBC connection. When I try running the code, I receive an "Undefined function 'CHAR' in expression. Here is the portion of my code using char. Can anyone tell me what I'm missing here?

Thanks,

Tiff

CHAR(T1.CDR_ORIG_STRT_DTTM) AS CDR_ORIG_STRT_DTTM, CHAR(T1.CDR_ORIG_STOP_DTTM) AS CDR_ORIG_STOP_DTTM, SUM (1+ timestampdiff (4, char(CDR_ORIG_STOP_DTTM - CDR_ORIG_STRT_DTTM))) AS DURATION
 
You either need a reference to a library that houses Char() or you're not using the right type conversions. Here's the list of the conversion functions, return type, and their ranges as shown in the help file:

Code:
Function Return Type Range for expression argument 
CBool    Boolean   Any valid string or numeric expression. 
CByte    Byte      0 to 255. 
CCur     Currency  -922,337,203,685,477.5808 to 922,337,203,685,477.5807. 
CDate    Date      Any valid date expression. 
CDbl     Double    -1.79769313486231E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values. 
CDec     Decimal   +/-79,228,162,514,264,337,593,543,950,335 for zero-scaled numbers, that is, numbers with no decimal places. For numbers with 28 decimal places, the range is +/-7.9228162514264337593543950335. The smallest possible non-zero number is 0.0000000000000000000000000001. 
CInt     Integer   -32,768 to 32,767; fractions are rounded. 
CLng     Long      -2,147,483,648 to 2,147,483,647; fractions are rounded. 
CSng     Single    -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values. 
CStr     String    Returns for CStr depend on the expression argument. 
CVar     Variant   Same range as Double for numerics. Same range as String for non-numerics.


I hope this helps.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom