Forum Replies Created

Viewing 15 posts - 3,151 through 3,165 (of 3,543 total)

  • RE: header record in file

    I would bcp header data to one file, bcp the data to another and concatenate the two.

  • RE: Remote constraint

    Not in SQL7.

  • RE: Silly Question

    Hi Frank,

    'writing nice looking sql'

    Sure is, I try to make my code as tabular and indented as possible to make reading and understanding easy and especially for the next poor...

  • RE: GROUP BY WEEK

    Hi Jay,

    Just being picky but why do have 'HAVING COUNT(*) > 0' in the query? Is it not superfluous as the query cannot return month/year with a count of 0?

    Edited...

  • RE: Remote login and password in linked servers

    What do you mean by transfer?

  • RE: Silly Question

    Hi Frank,

    Actually three, 0, 1 and NULL. In the original and my query there is no provision for NULL and therefore i assumed (there's that word again) there were no...

  • RE: Silly Question

    Why better, I see nothing wrong with your way. Another way of writing it would be

     CREATE PROCEDURE dbo.spRef_GetCertifications
    
    (
    @activesOnly bit
    )
    AS
    SELECT ID, Name, IsActive, SubmittedOnGMT
    FROM...
  • RE: BCP/BULK INSERT using fixed length file

    I am on SLQ7 SP4 and I can import fixed length text files with or without cr/lf.

    Can you post table structure and sample data?

  • RE: Help big problem search between tow date fields

    Do you mean like this

    SELECT *, 
    
    (CASEWHEN (tarih >= CONVERT(varchar(11), DATEADD([day], 0, GETDATE()), 120)+'16:00:00')
    AND (tarihb <= CONVERT(varchar(11), DATEADD([day], 1, GETDATE()), 120)+'16:00:00')
    THEN 1
    WHEN...
  • RE: Union

    Several things

    Why have 4 unions

    Why are you grouping on more fields than in distinct

    Why group and distinct

    What do you mean by merging, do you mean concatenate as in FollowupType+CallType+Job...

  • RE: Jet db as a Linked Server in SQL 2000

    Make sure

    Access DB is not encrypted or secured

    The server has access to the file

    Change security to 'they will be mapped to' with a remote user of admin and no password.

    ...

  • RE: How can i find a the date of birthday ?

    This view will return values from the table plus two extra columns for BirthdayToday and BirthdayThisWeek

    DROP VIEW UserBirthDay 
    
    GO
    CREATE VIEW UserBirthDay AS
    SELECT...
  • RE: Text File Source trailing spaces

    If the field contains a LF then I think there must be a problem with the datafile. I have seen data where LF not converted and CR/LF added to each...

  • RE: How can i find a the date of birthday ?

     SET DATEFIRST 1 --Monday
    
    declare @startday int,@endday int
    set @startday = day(getdate()-datepart(weekday,getdate())+1)
    set @endday = @startday+6
    select FirstName,LastName
    from users
    where month(Date_born) = month(getdate())
    and day(Date_born) >= @startday
    and day(Date_born) <= @endday
  • RE: Complex Query -- Help needed

    The problem is in the last case (could not test this). It needs an extra bracket

    SUM(CASE WHEN (oh.quote_minutes >= 90 AND ISNULL(oh.timedorder,0))
    
    THEN 1 ELSE 0...

Viewing 15 posts - 3,151 through 3,165 (of 3,543 total)