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 biv343 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: *

  1. raydenl

    Restrict Form within Excel application bounds

    I am trying to popup a SizableToolWindow (Notification.cs) within an Excel application, but constrain it to within the bounds of the Excel application... at the present the form can be moved outside of the application. This is what I have: private void ThisWorkbook_Startup(object sender...
  2. raydenl

    Daylight savings query problem

    Our company has a table that contains one row for every period in every day. There are 48 periods per day so there are 48 rows per day in the table. The only exception is daylight savings days. On one day in March there is a day with 50 periods, and on one day in October there is a day with 46...
  3. raydenl

    Building up the second table using the first

    OK, next question. I have one table that contains all possible data. And another table that under perfect conditions should contain exactly the same data and number of rows, with the only difference being the myFactor column values. There are 48 periods per day. The structure of both tables...
  4. raydenl

    Tricky join problem

    Two separate queries produce these results: There are 48 periods per day. select a.mydate, a.myperiod, a.mycode, a.buysell, SUM(a.myvalue) from dbo.mytable a where a.mydate = '2006-03-01' and a.buysell = 'Buy' group by a.mydate, a.myperiod, a.mynode, a.buysell 2006-03-01 1 AAA...
  5. raydenl

    Tricky SQL stuff!

    yeah this would work most of the time, but, what if the previous value was greater than 24000 or <= 0, etc. so it really needs to get the actual value from the previous selected row, needs some sort of recursive solution?
  6. raydenl

    Tricky SQL stuff!

    Keeps saying invalid object name 'a', and it's refering to these two sections: from a outert from a innert
  7. raydenl

    Tricky SQL stuff!

    I have an sql statement like so: SELECT a.TDate, WeekStart=a.TDate-Cast(a.TDate - '11-Aug-2004' AS int) % 7, Adjusted=Case WHEN a.TDate <> '11-Aug-2004' THEN Case WHEN a.Total > 24000 THEN a.Total/4 ELSE Case WHEN a.Total > 0 THEN a.Total ELSE 0 -- here is where the problem needs to be...
  8. raydenl

    tricky SQL query

    That is not quite what I am after. I will explain it in a different way. This query gives me: select NZDate - CAST(NZDate - '1927-01-01' AS int) % 7 WeekStarting, avg(score) Avg_Score from myTable where (NZDate between '1927-01-01' and '2005-01-21') and name IN ('John','Bob','Harry') group by...
  9. raydenl

    tricky SQL query

    SELECT NZDate - CAST(NZDate - '2005-01-01' AS int) % 7 AS WeekStarting, sum(score)/7 from myTable where (NZDate between '2005-01-01' and '2005-01-21') and name IN ('John','Bob','Harry') group by NZDate - CAST(NZDate - '2005-01-01' AS int) % 7 order by weekstarting Hi, I have a query (above)...
  10. raydenl

    Group By problem

    Nope. If you read my post you will the the result set I want.
  11. raydenl

    Group By problem

    Ummm. nope thats not what i want, that will not group them in groups of 7 days.
  12. raydenl

    Group By problem

    Hi, Im trying to write an sql statement that takes a start date and an end date and groups by 7 days groups showing the start date of each 7 day group. example: select sum(blah), ??? from mytable where (datex between '2005-07-05' and '2005-07-18') group by ??? which would give: 2005-07-05...
  13. raydenl

    Make variable names at runtime

    Hi, This is kinda driving me crazy. Is there any way to concat the value of a counter variable to a variable name to make a new variable name??? e.g. values1 values2 values3 etc... This is what I'm trying to do: For i = 0 To (count - 1) ReDim values & i(numberOfCategories - 1) Next...
  14. raydenl

    Create a variable using variables?

    How do I join 2 variables to create a varible? e.g. For i = 1 to Count Response.Write &quot;<input type='text' name='part_no&quot; & i & &quot;' value = '&quot; & partNo & i & &quot;'>&quot; Next So the varible for the 'value' attribute should be partNo1, partNo2, partNo3, etc... How do I...
  15. raydenl

    SP Confusion

    Arghhhhhhh. Ok I am confused. My SP has two unique random ID generators to produce ID's for the two INSERT statements within it. But now for some reason it wont cause an error if the NOT NULL constraints are violated. It will insert perfectly if all the values are entered, but if I dont enter a...
  16. raydenl

    Hi, I have a problem with my IDENTI

    Hi, I have a problem with my IDENTITY column (item_id) and my INSERT statement into my 'inventory' table. The stored procedure is executed from VB6, if the user enters an error, and the INSERT statement does not complete the IDENTITY column still increments. i.e. The 'amount' field is NOT NULL...
  17. raydenl

    Why does only the first INSERT stat

    Sweet, I found the problem, I needed to put: SET NOCOUNT ON Now it works, I just dont know why CREATE PROCEDURE insert_inventory @item_name varchar(20), @description varchar(100), @notes varchar(255), @amount varchar(8) AS SET NOCOUNT ON DECLARE @item_id int DECLARE @transaction_date...
  18. raydenl

    Why does only the first INSERT stat

    It inserts into the expenditure table if I enter an amount, but the amount field is NOT NULL, so I need it to complain if nothing is entered in the amount field, but at present it just fails to insert the whole row if amount is NULL
  19. raydenl

    Why does only the first INSERT stat

    Yeah ADO. Cheers, I will have a look.

Part and Inventory Search

Back
Top