Endpoint Protection

 View Only
  • 1.  SQL Query For Policy Number Date

    Posted Jul 31, 2009 09:18 AM
    Hi All,
    can anyone point me in the right direction to create an SQL query to display the policy serila numbers for a specific month??

    So far I have the following:

    Select COMPUTER_NAME as [Computer Name],
    PROFILE_SERIAL_No as [Policy Number]

    from SEM_CLIENT, SEM_AGENT.

    This obviously displays all the records but I want to look at the policy numbers that show dated for Febuary 2009

    I was told that this might work to display a time range but I am not sure if it does the actual policy date??

    select  * from SEM_CLEINT where TIME_STAMP between '01-02-2009' AND '28-02-2009'



  • 2.  RE: SQL Query For Policy Number Date

    Posted Jul 31, 2009 11:41 AM
    This query will only display the policies that were created for the configured month. It does not display all of the policies used in a specific month.

    Select c.computer_name, a.profile_serial_no

    From

    Sem5.sem_computer c,

    Sem5.sem_agent.a

    Where

    a.computer_id = c.computer_id AND

    a.profile_serial_no like ‘%-02/%’ --numerical month

    --order by a.last_update_time
    ------------------------------
    For SQL 2005 -

    Select
    c.computer_name, a.profile_serial_no
    from
    sem5.sem_computer c, sem5.sem_agent a
    where
    a.computer_id = c.computer_id AND
    dbo.RegExMatch(
    '\w{4}\-02/[0-9]{2}/2009\x20\d{2}:\d{2}:\d{2}\x20\d{3}',
    profile_serial_no
    ) = 1
    --order by a.last_update_time

    I hope this helps,
    Thomas