Forum Replies Created

Viewing 15 posts - 406 through 420 (of 1,217 total)

  • RE: Splitting records > 30 mins.

    Yes, table structure and sample data would be nice... also, please specify what to do with records longer than 1 hour - should they be split into as many 30-minute records as...

  • RE: Calculating the Last Friday of any date

    You're right, thanks for the warning. This code only works with @mydate newer than the date used in the select. I copied it from a piece code meant for dates >...

  • RE: Calculating the Last Friday of any date

    No need to check dateformat if you use one of these:

    DECLARE @mydate datetime

    SET @mydate='20070209'

    SELECT DATEADD(day, (DATEDIFF (day, '19990101', @mydate) / 7) * 7, '19990101') as friday_including_mydate

    SELECT DATEADD(day, (DATEDIFF (day, '19990102',...

  • RE: SELECT into an UPDATE

    I'd suggest not to use the same alias twice in a query, Lynn. You are using "s" for both Table1 and the derived table. Not only it is easy to make...

  • RE: how to check on six fields if the same value exist

    I'm not sure I understand correctly... Please tell me if this is it:

    There are 6 listboxes, all of them contain the same values (the same list of products). After the user sets...

  • RE: Insert statement

    If the insert is too slow, check that both tables are indexed properly and that indexes are not fragmented (see DBCC INDEXDEFRAG and DBCC DBREINDEX if you don't know what...

  • RE: results all on one line

    In case you need several rows to be returned (example : list of products with column "colour", showing all available colours for each respective product in form 'red, white, blue'), you...

  • RE: Complicated Count???

    BOL = BooksOnLine = SQL Server Help files

  • RE: Complicated Count???

    You're welcome! For me it is mainly practice (reading BOL included here), reading the articles and posts here on SQL Server Central to get new ideas and find out which seemingly...

  • RE: Complicated Count???

    Another way how to do the same: build the query step by step, from "inside" - first get distinct reports only ("Reports"), then count the number of reports for each player...

  • RE: Temporary Tables

    The text has been made a bit confusing by the red/blue coloring... so just to make sure nobody misunderstands that : not table variables, but transactions (involving these table variables) last...

  • RE: Fields Concatenation in SQL Query

    Try to test just these two statements you posted, on a large table, if there is any difference. My guess is that the difference will be minimal and not worth considering...

  • RE: Error - The entire resultset must be returned before this row can be updated

    I've been away for a week and couldn't reply... I don't know WHY the conversion takes so long, but SQL Server is doing conversion internally when you compare two values that...

  • RE: Select All Where SUM(column) 0

    Yes, that's it... just with HAVING SUM([Sale Amount])<>0, because you want to see all not equal to zero, not only those bigger than zero.

    There could be a question how...

  • RE: NULL Equals NULL?

    Well, that's your opinion, Boudjakdji.

    Thanks for sharing it, but I don't agree with you. NULL is part of the SQL, and while one should always consider, whether allowing nulls in certain...

Viewing 15 posts - 406 through 420 (of 1,217 total)