SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    0 Post(s)
    0 Thread(s)

    ASP wth OWC components - urgent

    I have a table in oracle with fields customer( time_stamp,cur_customer)
    tie_stamp with date format - 12-jan-2012
    curcustomer number

    I have multiple customers against date so i have to sum(cur_customer)
    I have to use select query in asp which :
    Ssqlstr = "select time_stamp,sum(cur_customers) tot_cust from custmers "
    sqlstr = sqlstr + "where time_stamp between '09:03 12/20/2012' and '09:03 12/22/2012'

    sqlstr = sqlstr + "group by time_stamp"

    My this query is not working because of date format. Can anyone help in qury and then create line graph with this recordset
    set rsTotRec = DBConn.Execute(sqlstr)

    rsChart.CursorLocation = 3 'adUseClient

    rsChart.Open sqlstr, DBConn, 3 'adOpenStatic

    'Add a Clustered Column Chart with a legend to the Chartspace
    set m_cspace = server.CreateObject("OWC11.Chartspace")

    'set the Chartspace's data source to the Recordset and add the
    'Type field for series names, the dec_name field for the chart's
    'categories and the Cust_Aff field for the chart's values

    set m_cspace.DataSource = rsChart

    ' The following statement will create a new chart (therefore 2 charts)

    set cht = m_cspace.Charts.Add

    set c = m_cspace.Constants
    cht.Type = c.chChartTypeLine
    cht.Type = c.chChartTypeLineMarkers

    cht.HasLegend = True

    m_cspace.SetData c.chDimSeriesNames, 0, "series"
    m_cspace.SetData c.chDimCategories, 0,"time_stamp"
    m_cspace.SetData c.chDimValues, 0,"tot_cust"

    This is also not working can anyone help please i am not getting th y axis.

    'add a chart title and format the title
    cht.HasTitle = True
    cht.Title.Caption = "P e r f o r m a n c e M o n i t o r" & chr(10) & "Number of customers out between '2012122100' and '2012122200'"
    set fnt = cht.Title.Font
    fnt.Name = "Tahoma"
    fnt.Size = 10
    fnt.Bold = True
    fnt.Color = "DarkBlue"
    'fnt.underline = true

    'cht.SeriesCollection(0).Line.Color = "#FE2E2E"

    'add a title to the category axis and format the title
    set ax = cht.Axes(c.chAxisPositionBottom)
    ax.HasTitle = True
    ax.Title.Caption = "Time (YY/MM/DD HH24:MI)"
    set fnt = ax.Title.Font
    fnt.Name = "Tahoma"
    fnt.Size = 10
    fnt.Bold = True
    'Format the Category axis
    ax.TickLabelSpacing = Interval_Hourly
    ax.MajorUnit = Interval_Hourly
    ax.HasMajorGridlines = true

    'add a title to the value axis and format the title
    set ax = cht.Axes(c.chAxisPositionLeft)
    ax.NumberFormat = "General"
    ax.HasTitle = True
    ax.Title.Caption = "# of Customers Affected"
    set fnt = ax.Title.Font
    fnt.Name = "Tahoma"
    fnt.Size = 10
    fnt.Bold = True


  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2012
    0 Post(s)
    0 Thread(s)
    what happens when you try this query ?
    sqlstr = "select time_stamp,sum(cur_customers) as tot_cust from customers "
    sqlstr = sqlstr + "where TRUNC(time_stamp) between '12/20/2012' and '12/22/2012'


Posting Permissions

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