Viewing 15 posts - 4,936 through 4,950 (of 6,036 total)
1. Your table design is wrong.
It must be:
InvoiceID int,
PaymentDate datetime,
PaymentTypeID smallint,
PaymentAmount money
2. Does not matter. Fix No.1.
October 15, 2006 at 3:04 pm
So, what's a problem?
SELECT SUM(Cash) + SUM(Cheque) + SUM(CC) + SUM(Account) + SUM(Total) + SUM(Gst) + etc
WHERE mydate >= @StartDate and mydate < @EndDate+1
October 15, 2006 at 4:17 am
Mark, you're welcome.
Hope, you don't take all suggestions above as solutions, you take it just like directions.
Because otherwise you are in trouble. ![]()
October 14, 2006 at 9:29 pm
Jeff, are you sure 26 seconds is good enough?
Especially comparing to under 1 second from computed column?
Not everyone is that lucky to have 26 seconds to wait.
I have requirement...
October 13, 2006 at 10:44 pm
Who needs to read that boring ANSI stuff?
![]()
October 13, 2006 at 5:28 pm
I see a join from sysindexes to sysobjects: si.id = OBJECT_ID(so.name)
BTW, quite, mmm..., not reasonable. It must be just si.id = so.id.
But where is your join to...
October 13, 2006 at 5:20 pm
What are you trying to save?
Database space or form space?
Empty value in nvarchar cell takes 3 bytes. Every charachter adds 2 bytes.
So, value '1,2' will take 9 bytes, smallint 1...
October 13, 2006 at 4:36 pm
1) What for?
2) If there is no database name what will tell you which database this particular table belongs to?
October 13, 2006 at 4:20 pm
Help for what?
CREATE TABLE [citrixlog] (
[TimeGenerated] [datetime] NULL ,
GeneratedOnHour AS (dateadd(hh, DATEPART(hh, TimeGenerated), dateadd(dd, datediff(dd, 0, TimeGenerated), 0) ) ) ,
[SessionID] [int] NULL ,
[ClientName] [varchar] (255)...
October 13, 2006 at 4:11 pm
As I understand your ID is not unique.
So how SQL Server must know which of ID's in primary table the ID in FK table is referencing?
In other words: can...
October 13, 2006 at 4:04 pm
1) Why all those Generated... columns are varchar(255) ?
Just in case?
Tinyint would be absolutely enough. Except for Year, where smallint would be required
2) drop all those useless columns.
3) Create 1...
October 13, 2006 at 2:11 am
Add computed colmn:
= dateadd(hh, DATEPART(hh, Entrytime), dateadd(dd, datediff(dd, 0, Entrytime), 0) ) AS HourStart
and create index on it.
After that you may group by that column.
October 12, 2006 at 5:46 pm
October 12, 2006 at 12:15 am
October 11, 2006 at 11:18 pm
You did not asked the question.
Point is: #Tables are limited to the scope.
If you created and/or populated #Table in another dynamic statement then this table was dropped as soon as...
October 11, 2006 at 11:00 pm
Viewing 15 posts - 4,936 through 4,950 (of 6,036 total)