Viewing 15 posts - 1 through 15 (of 26 total)
Hi Again Aaron!
I have some problems with this query. Will you still help me?
In the test db i...
November 19, 2004 at 4:51 am
if i understand you correct.
SET dateformat dmy
Declare @starttime datetime
Declare @stoptime datetime
Set @starttime = '11.10.2004 08:00:00'
Set @stoptime = '11.10.2004 17:59:59'
SELECT * FROM <your table> WHERE start between @starttime and @stoptime AND finish between @starttime and @stoptime
Morten
October 11, 2004 at 9:08 am
Very close now. The count of days and cars are extremly high. It is about over 2000 active cars every mont and that isent...
October 11, 2004 at 8:51 am
Sorry that im no better than this.
Server: Msg 207, Level 16, State 3, Line 41
Invalid column name 'GjelderFra'.
October 11, 2004 at 8:12 am
Sorry!
Server: Msg 107, Level 16, State 2, Line 16
The column prefix 'AN' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16,...
October 11, 2004 at 7:44 am
Hi again!
error:
Server: Msg 170, Level 15, State 1, Line 22
Line 22: Incorrect syntax near ','.
its her --> , AN.ANAvn
The code look like this now:
-- Get a listing of...
October 11, 2004 at 7:35 am
Hi Aron!
i have created the table.
Where shall i put this code?
INSERT INTO #Months
SELECT MonthsTable.TheMonth AS MonthGroup,
case when DATEPART( month, GjelderFra ) = 1 then 'Januar'
when DATEPART( month,...
October 11, 2004 at 7:26 am
It is the where statement who go against the "dato" field that generates the date with cars, but i cant see to solve the problem. It is this i must change....
October 11, 2004 at 1:51 am
I dont get the message if i remove --ALTER TABLE #Months
October 8, 2004 at 8:27 am
Thanks!
Server: Msg 156, Level 15, State 1, Line 36
Incorrect syntax near the keyword 'Create'.
Create table #DataRows ( RowLabel varchar(100), BID int
, Regnr varchar(7), ANavn varchar(50), GjelderFra datetime
, SiOppForsikringFra...
October 8, 2004 at 8:23 am
The posts when i run...
SELECT COUNT (DISTINCT GjelderFra)
FROM marsh_HKL.tblhertzkorttidsleiebiler
LEFT JOIN marsh_HKL.tblhertzkorttidsleieAvdeling
ON FKBRAvdeling=AID
THIS IS 383
SELECT COUNT (DISTINCT GjelderFra)
FROM marsh_HKL.tblhertzkorttidsleiebiler, marsh_HKL.tblhertzkorttidsleieAvdeling
WHERE FKBRAvdeling=AID
THIS IS...
October 8, 2004 at 3:15 am
An new error become:
Server: Msg 156, Level 15, State 1, Line 36
Incorrect syntax near the keyword 'Create'.
Server: Msg 156, Level 15, State 1, Line 62
Incorrect syntax near the keyword 'ON'.
Morten
October 8, 2004 at 2:39 am
I dont get the error if i change
SELECT DISTINCT GjelderFra FROM marsh_HKL.tblhertzkorttidsleiebiler
LEFT JOIN marsh_HKL.tblhertzkorttidsleieAvdeling
ON FKBRAvdeling=AID --AND GjelderFra between @datoFOM and @datoTOM
to
FROM marsh_HKL.tblhertzkorttidsleiebiler
LEFT JOIN marsh_HKL.tblhertzkorttidsleieAvdeling...
October 7, 2004 at 10:16 am
Hi!
I run this i query an...
-- Get a listing of every month to be summarized
if(object_id('tempdb.dbo.#Months')<>1)
drop table #Months
if(object_id('tempdb.dbo.#DataRows')<>1)
drop table #DataRows
Create table #Months ( MonthGroup smalldatetime, MonthName varchar(25), ANAvn varchar(50) )
INSERT INTO...
October 7, 2004 at 10:10 am
The error now is
Server: Msg 207, Level 16, State 1, Line 16
Invalid column name 'GjelderFra'.
Server: Msg 207, Level 16, State 1, Line 16
Invalid column name 'ANAvn'.
October 7, 2004 at 9:12 am
Viewing 15 posts - 1 through 15 (of 26 total)