Forum Replies Created

Viewing 11 posts - 91 through 101 (of 101 total)

  • RE: Display Duplicates

    Hi,

    I have written the following query using the temp table #calls. Just change it to the name of your table and check the column names are correct. Basically...

  • RE: Function that populates an existing table with data

    Hi terickso,

    This query (some column names will differ) gives the basic info you are after...

    select #project.projectnum, #WorkCalendar.q, count(#WorkCalendar.dt) as days

    from #project inner join #WorkCalendar on #project.startdate = #WorkCalendar.dt

    where #WorkCalendar.isWeekDay=1...

  • RE: Number of Dates in a Date Range by Quarter

    Something a bit like this....

    select model.startdate, model.enddate, WorkCalendar.q, count(WorkCalendar.dt)

    from model inner join WorkCalendar on model.startdate = WorkCalendar.dt

    where WorkCalendar.isWeekDay=1 and WorkCalendar.isHoliday=0

    group by model.startdate, model.enddate, WorkCalendar.q

  • RE: Number of Dates in a Date Range by Quarter

    Can you tell me the structure of the table (table name, column names) and I can show you the query...

  • RE: Number of Dates in a Date Range by Quarter

    Hi.

    There are a few scripts on the net that could serve as a good basis for what you need. Eg

    http://stackoverflow.com/questions/252519?sort=votes

    You could then write another function that calls...

  • RE: Adding a Total Column with a Pivot Table

    Jason is right.... Why didn't I see the obvious?!?!

    B

  • RE: Adding a Total Column with a Pivot Table

    Hi.

    My first thought is to put your result set into a common table expression and select what you want from that.

    The following code is untested but should put...

  • RE: Last week dates

    hi,

    One way to get those dates is:

    select dateadd(dd,-(6+datepart(dw, getdate())),getdate())

    select dateadd(dd,-datepart(dw, getdate()),getdate())

    Of course that will give you the time as well which could cause problems. To format it differently you...

  • RE: Aggregation over multiple columns

    Hi John,

    Ideally you need to redesign so that the skills , and SkillsPerPerson are stored in separate tables...

    Person

    --------

    PersonID

    PersonName....

    Skills

    -----

    SkillID

    SkillName....

    PersonSkills

    ----------

    PersonID

    SkillID

    Designing the tables in this way will mean the database design will not...

  • RE: Data Refresh

    Hi,

    It's hard to say exactly what the person is after without more details. You will probably need to speak to the person who made the request and ask for...

  • RE: How to find common sounding words in database?

    Hi,

    I would suggest using functions like soundex and difference.

    Here is an example:

    create table #temporaryNames ( names varchar(128) null)

    insert #temporaryNames

    select 'Ltd.'

    union select 'Limited'

    union select 'Leemited'

    union select 'Limeeted'

    union select 'Limitted'

    union select...

Viewing 11 posts - 91 through 101 (of 101 total)