Forum Replies Created

Viewing 15 posts - 31 through 45 (of 55 total)

  • RE: syntax error???

    jbalbo (1/11/2012)


    Hi,

    Getting a syntax error on the following..

    INSERT INTO @TEMPTABLE(TAG_NAME,TAG_DATA)

    SELECT TAG_NAME = 'CUST_AGE',...

  • RE: Add Convert for UTC time

    worker bee (1/11/2012)


    This converted the date but now I need to count...

    SELECT

    CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111)

    FROM Alerts

    WHERE (Heading LIKE 'Disk...

  • RE: Timed Out when calling from VBA function

    Not a VB dev, but in C# we set the SqlCommand.Timeout. Most likely it is the connection or command in your VB code that is actually Timing out, not the...

  • RE: Add Convert for UTC time

    worker bee (1/11/2012)


    I get an error on the CAST;

    select ServerName, Heading, UTCOccurrenceDateTime

    REPLACE(CAST(UTCOccurrenceDateTime as date),'-','/')

    from dbo.Alerts where Heading like '%blocking%'

    AND DATEADD(hh, -6, UTCOccurrenceDateTime) >= DATEADD(day, DATEDIFF(day, 0, GETUTCDATE()), 0)

    order...

  • RE: Help with Counts

    Try this bick, and please reply with the results... I am not on a machine with management studio, so can't test.

    SELECT datakey,COUNT(datakey) OVER(Partition by datakey) AS Uniquedatakey,

    ...

  • RE: Help with Counts

    Have not tested this, but :

    SELECT COUNT(DISTINCT datakey) OVER(Partition by datakey) AS Uniquedatakey,

    COUNT(DISTINCT CASE WHEN landline<>'' THEN landline END) OVER(Partition by datakey) AS...

  • RE: Retrieving rows with unique data in certain fields

    Ooo. Sorry, I think I missinterpreted your requirements.

    Try this instead:

    SELECT qid, postcode_area, vehicle_group, premium, lic_years, ncb, proposer_age, email, created

    FROM Mainstreet.dbo.leads l

    ---------------

    --try this join

    inner join (

    SELECT distinct id

    FROM Mainstreet.dbo.leads

    ) le

    on l.email...

  • RE: Retrieving rows with unique data in certain fields

    mike.barrett (1/11/2012)


    I have yet to come up with a simple but fast way of retrieving rows from a table that have unique values in one or sometimes more than one...

  • RE: Add Convert for UTC time

    worker bee (1/11/2012)


    Okay, I have to add a convert for the UTC column and I have no idea where to put it, can some one help me out real quick?

    add...

  • RE: Returning results for the previous year

    Gianluca Sartori (1/11/2012)


    Maybe, indented properly it's less confusing: 😉

    WITH MeaningfulCTEName AS (

    SELECT c.owneridname as BSC,

    z.Tpl_TotalGWP as Total2012,

    ...

  • RE: query using time

    the following query

    select member_number, date, time_in, time_out from member_time where time_out <='9:30 am' gives the following data

    member_number date time_in time_out

    2550 1/9/2012 7:55:31 AM 1:08:15 PM

    2563 1/9/2012 7:55:59 AM 4:30:00...

  • RE: Need to audit update without cursor

    Not sure I fully understand the requirements, but why don't you just declare your parameters and then do your If/Else statements, and drop the cursor all together?

    Stephen

  • RE: Help on TSQL update statement

    In an attempt to help, you could obviously do some sort of +1 if/else statement, or a case when statement to a variable. The below code is very basic and...

  • RE: Not Only SQL

    "Big Data" I dream about. Being a young, junior DBA/developer/BI analyst, on a small project, I hope to one day dive right into the world of big data. I can't...

  • RE: Jobs for Data Scientists

    Thank you all for the good luck. I am hoping to become a more active member of SQL Server Central, and attending a SQL conference in the near future!

    -Stephen

Viewing 15 posts - 31 through 45 (of 55 total)