Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: techzone12
  • Order by date
  1. techzone12

    how to perform an agregate on two non uniform tables

    Here is what I have and I think it works: insert totals (date_stamp, KWH ) select dateadd( day, datediff( day, 0, getdate() ), -1 ), ( (select KWH from Daily where D1.Date_Stamp = dateadd( day, datediff( day, 0, getdate() ), -1 )) + (select...
  2. techzone12

    how to perform an agregate on two non uniform tables

    Directly in SQL with a Stored procedure
  3. techzone12

    how to perform an agregate on two non uniform tables

    I have a table called "Daily" (Daily data) that looks like this: DateStamp KWH 11/6/2005 1867 11/7/2005 2001 11/8/2005 2023 . . A second table called "15_min" (15 minute data) looks like this: [DateTime] KW 11/8/2005 00:00 am 201 11/8/2005 00:15 am 198 ...
  4. techzone12

    How to update Table in dB with new data

    I have this code that displays the results of a select query: <%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit%> <HTML> <body> <% ' Open Database connection '*********************************************** DIM objConn, dbname, data_source Set objConn = Server.CreateObject("ADODB.Connection")...
  5. techzone12

    How to pass DateTime variable to stored procedure

    Here is how I got it to work, in case some body is interested in this later. CREATE PROCEDURE [Proc1] @strDateVariable varchar(50) AS Exec('SELECT DateTime1 , TotalKWH FROM table1 WHERE DateTime1 > convert(datetime,''' + @strDateVariable + ''', 101)') Notice that the DateVariable is passed...
  6. techzone12

    How to pass DateTime variable to stored procedure

    Oops, Sorry guys!!.It does not work yet. It does not generate errors, but the query does not produce the correct results. I am basically getting the entire table. So basically the condition TimeStamp > '1/1/2005' is not evaluating correctly. The '1/1/2005', which is passed as a string to the...
  7. techzone12

    How to pass DateTime variable to stored procedure

    Thank you all for all the valuable hints. you pointed me in the right direction. I got it to work by doing this in the ASP code: DateVariable = "'01/01/2005'" objRs.Open "Execute Proc1 " & strTableName & ", " & strColumn & " ," & DateVariable, objConn The change I made to the stored...
  8. techzone12

    How to pass DateTime variable to stored procedure

    I am getting the following error when I ran it in query analyzer: Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near '•'. Apparantly it doesn't like the way the date variable is formatted?
  9. techzone12

    How to pass DateTime variable to stored procedure

    The Column TimeStamp is a "DateTime" type. This column in table1 has ONLY the Date and not the time portion, i.e 10/18/2005.
  10. techzone12

    How to pass DateTime variable to stored procedure

    In the ASP page I set the DateVariable as follows: DateVariable = "1/1/2005" And I am getting an error at this line: objRs.Open "Execute Proc1 " & strTableName & ", " & strColumn & " ," & DateVariable, objConn It says: Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E14) Line 1...
  11. techzone12

    How to pass DateTime variable to stored procedure

    I have some ASP code that looks like this: objRs.Open "Execute Proc1 " & strTableName & ", " & strColumn , objConn The Stored procedure "Proc1" looks like this: CREATE PROCEDURE [Proc1] @strTable varchar(50), @strColumn varchar(50) AS Exec('SELECT ' + @strColumn + ' FROM ' + @strtable + '...
  12. techzone12

    How to pass DateTime to stored procedure from ASP

    Can you show me the stored procedure SQL code too?
  13. techzone12

    How to pass DateTime to stored procedure from ASP

    How can I pass DateTime Paramter to stored procedure from within an ASP page? Can you give me an example - or maybe point me to a link where this is explained? Thanks
  14. techzone12

    How to pass Multiple aparamters, including datetime to sp

    Thanks for the hint. And sorry for posting two questions in one thread. I will leave this thread just for how to pass multiple paramters to Stored procedure. In the ASP page I do the following: oRs.Open "Execute sp_Proc " & strTable & ", " & strColumn , conn In the Stored procedure, I would...
  15. techzone12

    How to pass Multiple aparamters, including datetime to sp

    I have an ASP page with this code: strTable = "table1" oRsSubs.Open "Execute sp_Proc " & strTable, conn The stored procedure in SQL looks like this: CREATE PROCEDURE sp_Proc ( @strTable varchar(50) ) AS EXEC('SELECT * FROM ' + @strTable) This work fine. I am trying however to add some...
  16. techzone12

    how to pass paramters form ASP to SQL Stored Procedures

    Sorry I got side-tracked. Yes your method works fine. I did this in the ASP page: oRs.Open "Exec spSelectAll " & sName, conn The stored procedure is as outlined above. Thanks for the help
  17. techzone12

    how to pass paramters form ASP to SQL Stored Procedures

    How would the stored procedure look like? If I am trying to do something like: select * from @sName Thanks
  18. techzone12

    how to pass paramters form ASP to SQL Stored Procedures

    I have an ASP page that contains a database table name as a string variable, i.e "strTableName". I need to pass this string form the ASP page to a SQL stored procedure. The sp will execute something like: select * from @strTableName The results will be retured to the ASP in a record Set. How...
  19. techzone12

    SQL conditional query with DateTime

    Great!!. It works just fine. I changed it to "between 8 and 19", as vongrunt has suggested. This is because "between" is inclusive or "closed ended". Thanks a lot!
  20. techzone12

    SQL conditional query with DateTime

    I have a SQL View called "KWH_Daily", and it’s driven by a 15 minutes table called "KW_15min" The 15-min table has data in 15-min intervals, i.e.: [DateTime] KW 9/13/2005 11:00 am 300 9/13/2005 11:15 am 304 9/13/2005 11:30 am 298 The Daily View (KWH_Daily) is constructed by using the...

Part and Inventory Search

Back
Top