Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Select into from(Select statement Function

Author  Topic 

Makaio780
Starting Member

24 Posts

Posted - 2012-08-16 : 11:08:20
How can i get this function to work?

Function MonthlyLiveTicketSnapshot()

Dim db As Database
Dim StrSQL, StrSQL2 As String

Set db = CurrentDb

StrSQL = "select Classification,[Low],[Medium],[High],[Critical],GetDate() as CaptureDate INTO vTbl_Open_Tickets_Snapshot From(Select Incident_Number,Priority,Classification From vars76_hpd_help_desk inner join vTbl_Remedy_Group_Classification ON vARS76_HPD_Help_Desk.Assigned_Group = vTbl_Remedy_Group_Classification.Group_Name where (status = 'Assigned' or status = 'New' or status = 'Pending' or status = 'in progress'))t PIVOT (COUNT(Incident_number) FOR Priority IN ([Low],[Medium],[High],[Critical]))p ORDER BY Classification"
db.Execute (StrSQL2)

Set db = Nothing

End Function

Makaio
   

- Advertisement -