+ Reply to Thread
Results 1 to 3 of 3

Couple of Basic SQL Queries - Numbers to 2 d.p, IF Calculated Field & Data Cleansing

  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Couple of Basic SQL Queries - Numbers to 2 d.p, IF Calculated Field & Data Cleansing

    Hi,

    I'm a relative newbie on the SQL front and as such I'd be grateful if someone could give me a few pointers on the following queries. I've pulled together the following query but I'd like to tweak it to achieve the following:

    SELECT [FinancialYear]
    ,[EvidencedSpend]
    ,[Role Category]
    ,RTRIM([Role Classification]) AS 'Role Classification'
    ,[Unit of Purchase]
    ,[No of Chargeable Days/Hours]
    ,[Price per Unit]
    ,[Temporary Worker pay Rate ]
    ,[Supplier Fee Percentage Applied if applicable ]
    ,[Supplier Fee Charged Per Day £]
    ,[Management Fee Charged Per Hour / Day £]
    ,[Expenses/Disbursements]
    FROM [MISO_Views].[mi].[MI_RMXXX]
    WHERE FinancialYear IN ('2015/16','2016/17','2017/18') AND NOT LotNumber = '0'


    • Return the 'Evidenced spend' field as 2 d.p.
    • Insert a calculated field so that if the 'Unit of Purchase' = 'Hour' it returns 8 * 'Price per unit' field otherwise return what is in the 'Price per unit' field which will be the day rate.
    • One of the categories in the 'Role Category' field is listed twice because for one of the financial years it is input as "Finance, Audit & Accountancy" whereas in the other FY's it is 'Finance, Audit & Accountancy' (no speech bubbles). Is it possible to cleanse the data in this field so that the speech bubbles are omitted?

    Thanks in advance,

    Snook

  2. #2
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Couple of Basic SQL Queries - Numbers to 2 d.p, IF Calculated Field & Data Cleansing

    I don't seem to be able to amend my original post but for the sake of accuracy the first bullet point should read:

    - Return the 'EvidencedSpend' field as 2 d.p.

  3. #3
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Couple of Basic SQL Queries - Numbers to 2 d.p, IF Calculated Field & Data Cleansing

    Update: I didn't realise that this forum received little traffic compared to the Excel ones so I've marked it as 'solved' and created an account on an SQL dedicated forum.

    Snook
    Last edited by The_Snook; 06-21-2017 at 04:48 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 11-01-2016, 12:47 PM
  2. Replies: 0
    Last Post: 08-15-2016, 02:07 PM
  3. Couple of Userform, Change event queries
    By welshman010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2014, 08:46 PM
  4. Replies: 0
    Last Post: 10-24-2013, 10:59 AM
  5. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  6. A couple of queries
    By Feline in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 02-09-2007, 10:49 AM
  7. Couple of vlookup queries
    By T De Villiers in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-27-2006, 03:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1