SQL 7 Calculation Problems

Results 1 to 2 of 2

Thread: SQL 7 Calculation Problems

  1. #1
    Join Date
    Dec 1969

    Default SQL 7 Calculation Problems

    The following is a query written in ASP to an ACCESS database, when pointed to SQL 7, the mathmatical calculations do not work, and it gets tied up with the "request.form" statement. Can anyone help me with how to rewrite it so it works in SQL 7?<BR><BR>oRSmt.Open "SELECT Date, Location, Server as [Server Name], (int (CPU*100)) as [CPU % Utilization], (int (Paging*10))/10 as [Memory Paging], (int (Queue*100))/10 as [Disk Queue], (int (IO*100)) as [Disk IO], (int (Users*1)) as [Active Users] FROM mailbox WHERE Location=&#039" & Request.Form("Location") & "&#039 ORDER BY CPU DESC;", "DSN=perf"<BR><BR><BR>Thanks....<BR><BR>Andy<BR><B R>

  2. #2
    Garth Guest

    Default RE: SQL 7 Calculation Problems

    SQL Server does not have an int() function. Replace int() with the CAST function. <BR><BR>DECLARE @CPU decimal(5,4)<BR>SET @CPU = &#039.679&#039<BR>SELECT CAST (@CPU*100 AS int) <BR><BR>--Results--<BR>----------- <BR>67<BR><BR>Garth<BR>www.SQLBook.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts