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...
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...
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...
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...
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?
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...
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...
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)...
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...
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...
How do I join 2 variables to create a varible?
e.g.
For i = 1 to Count
Response.Write "<input type='text' name='part_no" & i & "' value = '" & partNo & i & "'>"
Next
So the varible for the 'value' attribute should be partNo1, partNo2, partNo3, etc...
How do I...
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...
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...
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...
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.