Is it possible to do a calculation in a select query? What I need to do is get the date difference between ROW_ADD_TMS (date field) and SCNTR_ROW_VW_TMS (date field) then see if THAT number is greater than the number in character field SVP_ID (It is a character field for reasons beyond my control).<BR><BR>Can I use a SELECT Query to do that? Right now I pull the following select query:<BR><BR> mySQL="Select SRVC_CALL_NBR, CUST_BUS_NM, CUST_LAST_NM, CUST_FIRST_NM, SCNTR_ROW_VW_TMS, SVP_ID, ROW_ADD_TMS, SCNTR_REG_NBR "<BR> mySQL=mySQL+"from CUST_SRVC_CALL "<BR> mySQL=mySQL+"where SCNTR_USER_NBR=&#039TA&#039 "<BR> mySQL=mySQL+"AND SCNTR_REG_NBR&#060;&#062;&#039Y&#039 "<BR> mySQL=mySQL+"ORDER BY CUST_BUS_NM, CUST_LAST_NM, CUST_FIRST_NM"<BR><BR>Then I do the calculation:<BR>If isnull(rstemp(5)) then<BR> clr="BLACK"<BR>else<BR> vlu=0<BR> For x=len(trim(rstemp(5))) to 1 step -1<BR> digit=asc(mid(trim(rstemp(5)),x,1))-48<BR> vlu=vlu+digit*10^(len(trim(rstemp(5)))-x)<BR> next<BR> if vlu=0 then<BR> clr="BLACK"<BR> else<BR> if isnull(rstemp(4)) then<BR> if datevalue(now())-datevalue(rstemp(6)) &#062; vlu then<BR> clr="RED"<BR> else<BR> clr="BLACK"<BR> end if<BR> else<BR> if datevalue(now())-datevalue(rstemp(4)) &#062; vlu then<BR> clr="RED"<BR> else<BR> clr="BLACK"<BR> end if<BR> end if<BR> end if<BR>end if<BR><BR>To only display the records that are "RED".<BR><BR>I would love to get rid of the later calculation and just use a Select Query to do the job.<BR><BR>Help!!<BR><BR>Thanks,<BR><BR>Melissa