Forum Replies Created

Viewing 15 posts - 211 through 225 (of 231 total)

  • RE: Just pull back the MAX Date

    SELECT dbo.DW_SALESINVOICES_F.Reference AS [Sih.Reference],

    dbo.DW_SALESINVOICES_F.InvoiceDate AS [Sih.InvoiceDate],

    DATEPART(YYYY, dbo.DW_SALESINVOICES_F.InvoiceDate) AS [Sih.InvoiceYear],

    ...

  • RE: Just pull back the MAX Date

    Thanks for the reply - however I am getting the following error -

    Server: Msg 170, Level 15, State 1, Line 28

    Line 28: Incorrect syntax near '.'.

  • RE: Issue with Money to Varchar Conversion

    So easy when you know how.

    Thanks so much.

  • RE: Filtering WHERE on a field not in the DB

    Thanks managed to get the data.

  • RE: Filtering WHERE on a field not in the DB

    That's Correct. I am not totally new to SQL but have huge difficulty grasping the language.

    Thanks for your replies so far. My Code now looks like below -

    SELECT...

  • RE: Filtering WHERE on a field not in the DB

    Now have another issue -

    When I run the below query -

    SELECT TEN.[tenancy-ref] AS 'Tenancy Reference',

    TEN.[corr-name1] AS Name,

    ...

  • RE: Working Out Exact Age with DateDiff

    Thanks guys. I will give this a go and let you know how I get on.

  • RE: Working Out Exact Age with DateDiff

    AGE =

    -- Find difference in years and subtract 1 if date is before this years birthday

    ...

  • RE: Working Out Exact Age with DateDiff

    If below is my currect Select, where would I input your soloution please?

    SELECT dbo.[CORE_CO-PERSON].[PERSON-REF]AS Person_Reference,

    dbo.[CORE_CO-PERSON].[PERSON-TITLE] AS Person_Title,

    dbo.[CORE_CO-PERSON].[INITIALS]AS Initials,

    dbo.[CORE_CO-PERSON].[FORENAMES] AS Forenames,

    dbo.[CORE_CO-PERSON].[SURNAME]AS Surname,

    dbo.[IH_RE-TENANCY].[corr-name1]AS Name_On_Tenancy1,

    dbo.[IH_RE-TENANCY].[corr-name2]AS Name_On_Tenancy2,

    dbo.[CORE_CO-PERSON].[D-O-B] AS DateOfBirth,

    DATEDIFF (year,dbo.[CORE_CO-PERSON].[D-O-B],GETDATE())AS Age,

    dbo.[CORE_CO-PERSON].[NHI-NO] AS NationalInsurranceNumber,

    dbo.[CORE_CO-PERSON].[ORIGIN-CODE]AS EthnicOrigin,

    dbo.[CORE_CO-PERSON].[GENDER]AS...

  • RE: If Satatement

    Sorry - worked it out.

    Thanks guys

  • RE: If Satatement

    Hi there,

    Just to confirm it is a string value and will always be in the same format.

    Sorry, but I'm really useless when it comes to coding. Where exactly would...

  • RE: Need Help with TRIM

    Just to let you know I got this working.

    Thanks

  • RE: Need Help with TRIM

    Oh dear 🙂

    Thanks guys. This will hopefully make a lot more sense to me next month.

    Your help is really appreciated.

  • RE: Need Help with TRIM

    Still not working, now getting a Line 3: Incorrect syntax near '<'. error when I try and parse the query.

    The code now looks like

    (SELECT CONVERT(VARCHAR(10), MAX(ServiceOrdersJobs.ScheduledDate+2),)

    FROM dbo.ServiceOrdersJobs

    WHERE dbo.ServiceOrders.UID...

  • RE: Need Help with TRIM

    Thanks very much Gail.

    I will give it a go

Viewing 15 posts - 211 through 225 (of 231 total)