What Is Wrong With This TSQL Statement
hello,
I have wriiten this query to select all records from those tables in a database that have "to_be_transffered" column where this "to_be_transferred_column" is not null
--code
EXEC sp_MSForEachTable 'IF EXISTS(SELECT c.table_name, c.column_name
FROM information_schema.columns c
INNER JOIN information_schema.tables t
ON c.table_name = t.table_name
WHERE c.table_name = SUBSTRING(''?'', (CHARINDEX(''['',''?'', 2) + 1),
((LEN(''?'') - (CHARINDEX(''['',''?'', 2) + 1))))
AND c.column_name = ''to_be_transferred''
AND t.table_type = ''BASE TABLE''
)
BEGIN
SELECT * FROM ?
WHERE to_be_transferred IS NOT NULL
END'
But I am getting the following error
Msg 207, Level 16, State 3, Line 12
Invalid column name 'to_be_transferred'
I thought the if statement filters all those tables with the specified column and do select statement fot those tables only
what did I do wrong, any suggestionm?
Thanks
View Complete Forum Thread with Replies
Related Forum Messages:
TSQL - Use ORDER BY Statement Without Insertin The Field Name Into The SELECT Statement
Hi guys, I have the query below (running okay): Code Block SELECT DISTINCT Field01 AS 'Field01', Field02 AS 'Field02' FROM myTables WHERE Conditions are true ORDER BY Field01 The results are just as I need: Field01 Field02 ------------- ---------------------- 192473 8461760 192474 22810 Because other reasons. I need to modify that query to: Code Block SELECT DISTINCT Field01 AS 'Field01', Field02 AS 'Field02' INTO AuxiliaryTable FROM myTables WHERE Conditions are true ORDER BY Field01 SELECT DISTINCT [Field02] FROM AuxTable The the results are: Field02 ---------------------- 22810 8461760 And what I need is (without showing any other field): Field02 ---------------------- 8461760 22810 Is there any good suggestion? Thanks in advance for any help, Aldo.
View Replies !
I Need Help With This Tsql Statement
Every time I try this statement I keep getting a syntext error near count I must be over looking something can some one help me with this. SELECT 'Quarter 1' as 'qtr' count(jobid) as 'transcount', count(distinct job.patientid) as 'patientcount', sum(job.LANGUAGE_TCOST) as 'lcost', Sum(job.LANGUAGE_DISC_COST) as 'dlcost', avg(LANGUAGE_DISC) as 'avgLDisc', (sum(job.LANGUAGE_TCOST) + sum(job.LANGUAGE_DISC_COST)) as 'LGrossAmtBilled', (sum(LANGUAGE_TCOST) / count(distinct job.patientid)) as 'PatAvgL', (sum(LANGUAGE_TCOST) / count(jobid)) as 'RefAvgL', sum(LANGUAGE_DISC) as 'avgPercentDiscL', JOB.JURISDICTION, PAYER.PAY_COMPANY, PAYER.PAY_CITY, PAYER.PAY_STATE, PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE INVOICE_AR.INVOICE_DATE AS EXPR1, INVOICE_AR.AMOUNT_DUE FROM JOB INNER JOIN INVOICE_AR ON JOB.JOBID = INVOICE_AR.JOBID LEFT OUTER JOIN PAYER ON PAYER.PAYERID = JOB.PAYER.ID LEFT OUTER JOIN STATES ON JOB.JURISDICTION = STATES.INITIALS WHERE (INVOICE_AR.AMOUNT_DUE > 0)AND (INVOICE-AR.INVOICE_DATE BETWEEN @startdate and @enddate)AND (MONTH(INVOICE_AR.INVOICE_DATE) IN (1,2,3))AND (PAYER.PAYCOMPANY like '%' + @Company + '%') Group By JOB.JURISDICTION PAYER.PAY_COMPANY PAYER.PAY_CITY PAYER.PAY_STATE PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE, INVOICE_AR.INVOICE_DATE, INVOICE_AR.AMOUNT_DUE UNION ALL SELECT 'Quarter 2' as 'qtr' count(jobid) as 'transcount', count(distinct job.patientid) as 'patientcount', sum(job.LANGUAGE_TCOST) as 'lcost', Sum(job.LANGUAGE_DISC_COST) as 'dlcost', avg(LANGUAGE_DISC) as 'avgLDisc', (sum(job.LANGUAGE_TCOST) + sum(job.LANGUAGE_DISC_COST)) as 'LGrossAmtBilled', (sum(LANGUAGE_TCOST) / count(distinct job.patientid)) as 'PatAvgL', (sum(LANGUAGE_TCOST) / count(jobid)) as 'RefAvgL', sum(LANGUAGE_DISC) as 'avgPercentDiscL', JOB.JURISDICTION, PAYER.PAY_COMPANY, PAYER.PAY_CITY, PAYER.PAY_STATE, PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE INVOICE_AR.INVOICE_DATE AS EXPR1, INVOICE_AR.AMOUNT_DUE FROM JOB INNER JOIN INVOICE_AR ON JOB.JOBID = INVOICE_AR.JOBID LEFT OUTER JOIN PAYER ON PAYER.PAYERID = JOB.PAYER.ID LEFT OUTER JOIN STATES ON JOB.JURISDICTION = STATES.INITIALS WHERE (INVOICE_AR.AMOUNT_DUE > 0)AND (INVOICE-AR.INVOICE_DATE BETWEEN @startdate and @enddate)AND (MONTH(INVOICE_AR.INVOICE_DATE) IN (4,5,6))AND (PAYER.PAYCOMPANY like '%' + @Company + '%') Group By JOB.JURISDICTION PAYER.PAY_COMPANY PAYER.PAY_CITY PAYER.PAY_STATE PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE, INVOICE_AR.INVOICE_DATE, INVOICE_AR.AMOUNT_DUE UNION ALL SELECT 'Quarter 3' as 'qtr' count(jobid) as 'transcount', count(distinct job.patientid) as 'patientcount', sum(job.LANGUAGE_TCOST) as 'lcost', Sum(job.LANGUAGE_DISC_COST) as 'dlcost', avg(LANGUAGE_DISC) as 'avgLDisc', (sum(job.LANGUAGE_TCOST) + sum(job.LANGUAGE_DISC_COST)) as 'LGrossAmtBilled', (sum(LANGUAGE_TCOST) / count(distinct job.patientid)) as 'PatAvgL', (sum(LANGUAGE_TCOST) / count(jobid)) as 'RefAvgL', sum(LANGUAGE_DISC) as 'avgPercentDiscL', JOB.JURISDICTION, PAYER.PAY_COMPANY, PAYER.PAY_CITY, PAYER.PAY_STATE, PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE INVOICE_AR.INVOICE_DATE AS EXPR1, INVOICE_AR.AMOUNT_DUE FROM JOB INNER JOIN INVOICE_AR ON JOB.JOBID = INVOICE_AR.JOBID LEFT OUTER JOIN PAYER ON PAYER.PAYERID = JOB.PAYER.ID LEFT OUTER JOIN STATES ON JOB.JURISDICTION = STATES.INITIALS WHERE (INVOICE_AR.AMOUNT_DUE > 0)AND (INVOICE-AR.INVOICE_DATE BETWEEN @startdate and @enddate)AND (MONTH(INVOICE_AR.INVOICE_DATE) IN (7,8,9))AND (PAYER.PAYCOMPANY like '%' + @Company + '%') Group By JOB.JURISDICTION PAYER.PAY_COMPANY PAYER.PAY_CITY PAYER.PAY_STATE PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE, INVOICE_AR.INVOICE_DATE, INVOICE_AR.AMOUNT_DUE UNION ALL SELECT 'Quarter 4' as 'qtr' count(jobid) as 'transcount', count(distinct job.patientid) as 'patientcount', sum(job.LANGUAGE_TCOST) as 'lcost', Sum(job.LANGUAGE_DISC_COST) as 'dlcost', avg(LANGUAGE_DISC) as 'avgLDisc', (sum(job.LANGUAGE_TCOST) + sum(job.LANGUAGE_DISC_COST)) as 'LGrossAmtBilled', (sum(LANGUAGE_TCOST) / count(distinct job.patientid)) as 'PatAvgL', (sum(LANGUAGE_TCOST) / count(jobid)) as 'RefAvgL', sum(LANGUAGE_DISC) as 'avgPercentDiscL', JOB.JURISDICTION, PAYER.PAY_COMPANY, PAYER.PAY_CITY, PAYER.PAY_STATE, PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE INVOICE_AR.INVOICE_DATE AS EXPR1, INVOICE_AR.AMOUNT_DUE FROM JOB INNER JOIN INVOICE_AR ON JOB.JOBID = INVOICE_AR.JOBID LEFT OUTER JOIN PAYER ON PAYER.PAYERID = JOB.PAYER.ID LEFT OUTER JOIN STATES ON JOB.JURISDICTION = STATES.INITIALS WHERE (INVOICE_AR.AMOUNT_DUE > 0)AND (INVOICE-AR.INVOICE_DATE BETWEEN @startdate and @enddate)AND (MONTH(INVOICE_AR.INVOICE_DATE) IN (10,11,12))AND (PAYER.PAYCOMPANY like '%' + @Company + '%') Group By JOB.JURISDICTION PAYER.PAY_cOMPANY PAYER.PAY_CITY PAYER.PAY_STATE PAYER.PAY_SALES_STAFF_ID, JOB.INVOICE_DATE, INVOICE_AR.INVOICE_DATE, INVOICE_AR.AMOUNT_DUE Order By 'QTR' asc
View Replies !
TSQL - WITH Statement
Hi guys, I need help with this one... Iam Trying to understand how to use the statement WITH I am running the code below, but getting error. note: I have SQL SERVER 2005 in my PC, but retrieving data from the SQL SERVER 2000 (in the server) Thanks in advance, Aldo. Code Snippet WITH MyCTE (FILTER, SORTGROUP) AS ( SELECT ACCOUNTS.FILTER, ACCOUNTS.SORTGROUP FROM ACCOUNTS ) SELECT * FROM MyCTE AS CTE_01; Error Messages: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'WITH'.
View Replies !
What's Wrong With This Statement???
cmdSQL.Parameters.Add("@SlitWidth", System.Data.SqlDbType.Decimal).Value = IIf(slitwidth = "", System.DBNull.Value, cdec(slitwidth)) When I run the application, I get the following error: Conversion from string "" to type 'Decimal' is not valid I can't see where the problem is with this.. Thanks for any help!
View Replies !
What Is Wrong With My OR Statement?
I am trying to write a stored procedure with an OR statement and can't get it to work. Using SQL Server 2000. (wish I had SQL 2005) SELECT [C_CompanyName], [C_ID], [C_Email], [C_Phone], [C_SubExpireDate], [C_CompanyEmail] FROM [tblCompanies] WHERE ([C_Email] OR [C_CompanyEmail]) LIKE ('%' + @C_Email + '%') Compilers tells me there is a problem near the OR THank you
View Replies !
What Is Wrong With This Sql Statement
declare @name nvarchar(30) declare @Location nvarchar(30) declare @nonbill float declare @empType varchar(30) select @location=location, @Name = name, @empType = employeetype, @nonbill = CASE cbetts.v_payrolltotals.jobno WHEN left(cbetts.v_payrolltotals.jobno,3) = '900' THEN sum(totals) ELSE 0 END from cbetts.v_payrolltotals where userid = 1025 and we = '6/4/2004' i am getting the error for the case statment.. "Incorrect syntax near '=', Incorrect syntax near the keyword 'END'.
View Replies !
What Is Wrong With This Sql Statement
I need to do a count of the number of lines of record returned from the sub query below. However the server keeps giving an error something like this syntax error FROM CLAUSE. pls help me as it is urgent. SELECT COUNT(*) AS DP FROM (SELECT MOBIX.FROM_COSG_ID, MOBIX.TO_COSG_ID FROM Mobix WHERE (((Mobix.CONSG_DO_NO)=[testing])) GROUP BY Mobix.FROM_COSG_ID, Mobix.To_COSG_ID);
View Replies !
What's Wrong With This Statement
This is under the "Trigger Properties" section. CREATE TRIGGER [TRIGGER NAME] ON [dbo] FOR INSERT, UPDATE, DELETE AS We have very little experience with this so any help will be appreciated. In fact we even tried to hire someone to come out and look at it.... Never called back...????
View Replies !
What Is Wrong In This SQL STATEMENT?
Hi to every one I have tow tables on sqlce server Trans & Transd Trans is master (TTRID auto number) TransD is child Code Snippet cmd.CommandText = "insert trans ([trdate],[trtype],[trempid],[trloc])" _ & "Values('" & LbTime.Text & "', '" & cboType.Text & "', '" & txtEmpID.Text _ & "', '" & txtRBar.Text & "')" cmd.ExecuteNonQuery() cmd.CommandText = " SELECT MAX(TTRID) AS TTRID FROM Trans" rdr = cmd.ExecuteReader 'Here is aproblem If rdr.Read Then MsgBox(rdr.Item("TTRID")) LstAsset.SelectedIndex = 0 Do cmd.CommandText = "insert transd ([ttrid],[asssn])" _ & "Values('" & rdr.Item("TTRID") & "', '" & LstAsset.Text & "')" cmd.ExecuteNonQuery() If LstAsset.SelectedIndex < LstAsset.Items.Count - 1 Then LstAsset.SelectedIndex = LstAsset.SelectedIndex + 1 ElseIf LstAsset.SelectedIndex = LstAsset.Items.Count - 1 Then Exit Do End If Loop I try to read ttrid from reader but is say there is no Colum, but when i add if rdr.read it's wooooooooork. Whey???
View Replies !
What's Wrong With This Statement?
<%@ Language="VBSCRIPT" %> <!-- #include file="../includes/include.asp" --> <% connect.open connectString Dim testSQL testSQL = "INSERT INTO development (address) VALUES 'some address'" connect.execute(testSQL) %> <% connect.close() %> Any idea what could be wrong with this statement? It's causing the following error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. /asa_dev/gm/dbTest.asp, line 10 Thanks, Jason
View Replies !
What Is Wrong With My Statement?
I actualy using SQL server 2005. I'm a stored procedure and it's accusing error near '=' that is in case clause. Do you know in what I'm wrong? Select u.nick as 'user', l.nick as 'last_user', t.* from threads t inner join users u on t.user_id = u.user_id inner join users l on t.last_user_id = l.user_id where t.creation > @Period and forum_id=(@forum_id) and case when @PageType = 'votacao' then t.votacao = 1 end, case when @PageType = 'topicos' then t.votacao = 0 end, case when @PageType = 'todos' then end Thank you very much in advance.
View Replies !
How Can I Use Variables In This TSQL Statement
Hi all,I would like to replace the default directory location (c: emp) and thefilename (emails.csv) with variables like @FileDir and @FileName in thestatement below.SELECT @cnt = COUNT(*) FROM OpenRowset('MSDASQL', 'Driver={Microsoft TextDriver (*.txt; *.csv)}; DefaultDir=c: emp;','select * from "emails.csv"')However, my attempts have not been successful.Any ideas appreciated, and TIA.Greg
View Replies !
TSQL From An Access SQL Statement
Good morning one and all, I have some queries that were written in access that I need to port into SQL 7, the whole process is boring and mundane. Does any1 know of a translator (i.e. access sql to t-sql) or a reference to the differences between access SQL and t-Sql. Any and all help appreciated, Thanx Gurmi
View Replies !
Tsql Case Statement
Hi, Here is the scenario. I want to add last year sale dollars in accordance with current period in exsiting fact table. And below is the syntax. Syntax: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- select a. store_key, a.fisc_date_key, sum(a.net_sale_Dollars) as sale_TY , sum ( b.net_sale_dollars ) as sale_LY , a.division_name, a.department_number fromFact 1 as a ,Fact 1 as b Whereb.fisc_date_key = (a.fisc_date_key -364) and a.division_name=b.division_name and a.department_number =b.department_number and a.store_key = b.store_key group by a.division_name, a.department_number, a.fisc_date_key, a.store_key ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The current table from this query is showing like: store_key date_key sale_TY sales_LY div dept ------------------------------------------------------------------------------------------------ 1 1 30 20 ABC 1 2 1 20 20 ABC 3 But, if we assume that in the current date, dept = 2 has a sale amount, and in parallel year if dept=2 does not have any sale then this information was excluded. The structure of table that I want to create must look like: store_key date_key sale_TY sales_LY div dept ------------------------------------------------------------------------------------------------ 1 1 30 20 ABC 1 2 1 20 20 ABC 3 2 1 15 0 ABC 2 >>>> want to put 0 value where only one side ( current or parrallel period) has sales info. So, I'm thinking the case statement like: Case statement logic like: ------------------------------------------------------------ if a. dept not exist in b.dept then Sale TY -> a.net_sale_dollars Sale LY -> 0 if b.dept not exist in a.dept then sale TY -> 0 sale LY -> b. net_sale_dollars ------------------------------------------------------------- below is the syntax which doesn't work (it's wrong): Syntax: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- select a. store_key, a.fisc_date_key, sum(case when a.department_number = b.department_number then a.net_sale_dollars else case when a.department_number NOT IN (b.department_number)then a.net_sale_dollars else null end) as sale_TY , sum ( case when b.department_number =a.department_number then b.net_sale_dollars else case when a.department_number NOT IN (b.department_number) as sale_LY, a.division_name, a.department_number fromFact 1 as a Fact 1 as b Whereb.fisc_date_key = (a.fisc_date_key -364) and a.division_name=b.division_name and a.department_number =b.department_number and a.store_key = b.store_key group by a.division_name, a.department_number, a.fisc_date_key, a.store_key , ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Is it possible to create these kind of structure? Please give me some comments. Thanks.
View Replies !
Whats Wrong With This Statement
I am getting an error Msg 8155, Level 16, State 2, Procedure usp_ImportNewASC_ParticipantPlanFundBalances, Line 1No column was specified for column 49 of 'a'.I think its something to do with the line number 48 and 102 ALLOC_PER is char(9) so i want to to cast it as a int and insert into the prodction data. 1 UPDATE 2 Statements..ParticipantPlanFundBalances1 3 SET 4 Act1 = ACT_ID1, 5 TotAct1 = TOT_ACT1, 6 Act2 = ACT_ID2, 7 TotAct2 = TOT_ACT2, 8 Act3 = ACT_ID3, 9 TotAct3 = TOT_ACT3, 10 Act4 = ACT_ID4, 11 TotAct4 = TOT_ACT4, 12 Act5 = ACT_ID5, 13 TotAct5 = TOT_ACT5, 14 Act6 = ACT_ID6, 15 TotAct6 = TOT_ACT6, 16 Act7 = ACT_ID7, 17 TotAct7 = TOT_ACT7, 18 Act8 = ACT_ID8, 19 TotAct8 = TOT_ACT8, 20 Act9 = ACT_ID9, 21 TotAct9 = TOT_ACT9, 22 Act10 = ACT_ID10, 23 TotAct10 = TOT_ACT10, 24 Act11 = ACT_ID11, 25 TotAct11 = TOT_ACT11, 26 Act12 = ACT_ID12, 27 TotAct12 = TOT_ACT12, 28 Act13 = ACT_ID13, 29 TotAct13 = TOT_ACT13, 30 Act14 = ACT_ID14, 31 TotAct14 = TOT_ACT14, 32 Act15 = ACT_ID15, 33 TotAct15 = TOT_ACT15, 34 Act16 = ACT_ID16, 35 TotAct16 = TOT_ACT16, 36 Act17 = ACT_ID17, 37 TotAct17 = TOT_ACT17, 38 Act18 = ACT_ID18, 39 TotAct18 = TOT_ACT18, 40 Act19 = ACT_ID19, 41 TotAct19 = TOT_ACT19, 42 Act20 = ACT_ID20, 43 TotAct20 = TOT_ACT20, 44 OpeningUnits = UNIT_OP, 45 OPricePerUnit = PRICE_OP, 46 ClosingUnits = UNIT_CL, 47 CPricePerUnit = PRICE_CL, 48 AllocationPercent = i.ALLOC_PER1 49 50 FROM 51 Statements..ParticipantPlanFundBalances1 pfb 52 JOIN ( 53 Select 54 cp.PlanId, 55 p.ParticipantId, 56 @PeriodId Period, 57 f.FundId, 58 a.ACT_ID1, 59 a.TOT_ACT1, 60 a.ACT_ID2, 61 a.TOT_ACT2, 62 a.ACT_ID3, 63 a.TOT_ACT3, 64 a.ACT_ID4, 65 a.TOT_ACT4, 66 a.ACT_ID5, 67 a.TOT_ACT5, 68 a.ACT_ID6, 69 a.TOT_ACT6, 70 a.ACT_ID7, 71 a.TOT_ACT7, 72 a.ACT_ID8, 73 a.TOT_ACT8, 74 a.ACT_ID9, 75 a.TOT_ACT9, 76 a.ACT_ID10, 77 a.TOT_ACT10, 78 a.ACT_ID11, 79 a.TOT_ACT11, 80 a.ACT_ID12, 81 a.TOT_ACT12, 82 a.ACT_ID13, 83 a.TOT_ACT13, 84 a.ACT_ID14, 85 a.TOT_ACT14, 86 a.ACT_ID15, 87 a.TOT_ACT15, 88 a.ACT_ID16, 89 a.TOT_ACT16, 90 a.ACT_ID17, 91 a.TOT_ACT17, 92 a.ACT_ID18, 93 a.TOT_ACT18, 94 a.ACT_ID19, 95 a.TOT_ACT19, 96 a.ACT_ID20, 97 a.TOT_ACT20, 98 a.UNIT_OP, 99 a.PRICE_OP, 100 a.UNIT_CL, 101 a.PRICE_CL, 102 Cast(i.ALLOC_PER1 as int) 103 FROM 104 ASDBF a 105 -- Derive the unique PlanId from the Statements ClientPlan table 106 INNER JOIN Statements..ClientPlan cp 107 ON a.PLAN_NUM = cp.ClientPlanId 108 AND 109 cp.ClientId = @ClientId 110 -- Derive the unique ParticipantId from the Statements Participant table 111 INNER JOIN Statements..Participant p 112 ON a.PART_ID = p.PartId 113 --Derive the unique FundID from the Statements Fund Table... 114 INNER JOIN Statements..Fund f 115 ONa.FUND_ID = f.Cusip 116 OR 117 a.FUND_ID = f.Ticker 118 OR 119 a.FUND_ID = f.ClientFundId 120 -- get the allocation percent from the INVSRC 121 LEFT Outer JOIN INVSRC i 122 ONa.FUND_ID = i.INV_ID 123 AND 124 a.PLAN_NUM = i.Plan_Number 125 AND 126 a.PART_ID = i.PART_ID 127 --INNER JOIN Statements..AscActCodes as 128 --ON 129 130 WHERE 131 a.Import = 1 132 )a 133 ON pfb.PlanId = a.PlanId 134 AND 135 pfb.ParticipantId = a.ParticipantId 136 AND 137 pfb.PeriodId = PeriodId 138 AND 139 pfb.FundId = a.FundId 140 Any help will be appreciated Regards Karen
View Replies !
Can Any Body Tell Me What Wrong In My Sql Statement
Hi, can any body tell me what is wrong in my sql statement SELECT title, price, Budget = CASE price WHEN price > 20.00 THEN 'Expensive' WHEN price BETWEEN 10.00 AND 19.99 THEN 'Moderate' WHEN price < 10.00 THEN 'Inexpensive' ELSE 'Unknown' END FROM titles it gives me this error Msg 170, Level 15, State 1, Line 3 Line 3: Incorrect syntax near '>'. but when i use somthing like that i will works fine SELECT Budget i am using sql server 2000
View Replies !
INSERT INTO Statement, What Is Wrong With It?
INSERT INTO MainSearch (Date,Time,RemoteHost,Make,Model,PriceLower,PriceUpper) VALUES ('04/05/2004','12:35:49','127.0.0.1','AUDI','A6','1000','2000') It crashes and says "Error in INSERT INTO statement", can anyone help? Thanks
View Replies !
What's Wrong With My INSERT Statement?
Below is the code used to process information provided from a form connected it : Code: 'INSERTING INFO INTO THE VISITOR'S TABLE IN ATLAS when ALL info is needed - D is for Departure 'MAKE SURE to ENABLE ALL the passing-value formulas above for statement below to work properly mycn.Execute "Insert into visitor " & _ "(lastname,firstname,affiliation,visitortype,a1line1,a1line2,a1city,a1state,a1zip," & _ "a1country,homephone,workphone,email,dob,citizenship,idtype,idnumber,idplace," & _ "minor1,m1dob,minor2,m2dob,minor3,m3dob,event1,voyage,event,CBY)" & _ "values(" & _ LastName & FirstName & affiliation & visitortype & a1line1 & a1line2 & a1city & a1state & a1zip & _ a1country & homephone & workphone & email & dob & citizenship & idtype & idnumber & idplace & _ minor1 & m1dob & minor2 & m2dob & minor3 & m3dob & event1 & voyage & "'D','WEB')" set mycn = nothing The code works correctly how it is setup here but it is no longer useful for this new form. The event variable, set as 'D' in the values section now has to be decided on outside of the insert statement and for some reason when I make the change in red below I get an unknown error: Code: 'INSERTING INFO INTO THE VISITOR'S TABLE IN ATLAS when ALL info is needed - D is for Departure 'MAKE SURE to ENABLE ALL the passing-value formulas above for statement below to work properly mycn.Execute "Insert into visitor " & _ "(lastname,firstname,affiliation,visitortype,a1line1,a1line2,a1city,a1state,a1zip," & _ "a1country,homephone,workphone,email,dob,citizenship,idtype,idnumber,idplace," & _ "minor1,m1dob,minor2,m2dob,minor3,m3dob,event1,voyage,event,CBY)" & _ "values(" & _ LastName & FirstName & affiliation & visitortype & a1line1 & a1line2 & a1city & a1state & a1zip & _ a1country & homephone & workphone & email & dob & citizenship & idtype & idnumber & idplace & _ minor1 & m1dob & minor2 & m2dob & minor3 & m3dob & event1 & voyage & event & "'WEB')" set mycn = nothing
View Replies !
What's Wrong With This SELECT Statement
When I attempt to run the following select statement in Aqua I get 2 errors: - Incorrect syntax near the keyword 'SELECT'. - Incorrect syntax near ')'. I belive they both refer to the creation of the subquery (i.e. "From (" and ") t" ) but I can't for the life of me discover anything wrong with the statement. If you run the multiple union subquery by itself, it works just fine. (In case your wondering, the eventual the purpose of creating a sub query is so that I can use the UnPivot statement) SELECT DATE_DAY , METRIC , NUM_OF_TICKETS , SEVERITY , EQ_MARKET_CLUSTER --Performance , NUM_DISPATCH_TO , DURATION_DISPATCH_TO , SLA_DURATION_DISPATCH_TO , SLA_DURATION_DISPATCH_TO_G_L , NUM_DISPATCH_FROM , DURATION_DISPATCH_FROM , SLA_DURATION_DISPATCH_FROM , SLA_DURATION_DISPATCH_FROM_G_L , NUM_MTTR , DURATION_MTTR , SLA_MTTR , SLA_MTTR_G_L , COUNT_CLOSED_MET_DUE_DATE , NUM_CLOSED_MET_DUE_DATE --Costs , OVERTIME , COUNT_NTF , NUM_DISPATCH_NTF , NUM_CTS_DISPATCH , TICKET_NOT_DISPATCHED , REMOTE_RESTORAL --Productivity , NUM_TICKET_RATIO , NUM_TECHS_RATIO , NUM_DISPATCH_TICKET_RATIO --FMS , NUM_MET_DISPATCH_TO , MET_SLA_DISPATCH_TO , NUM_MET_DISPATCH_FROM , MET_SLA_DISPATCH_FROM , NUM_WIP , DURATION_WIP_TO_RESOLVE , SLA_WIP_TO_RESOLVE , SLA_WIP_TO_RESOLVE_G_L , NUM_MET_WIP , MET_SLA_WIP_TO_RESOLVE , NUM_MET_MTTR , MET_SLA_MTTR , COUNT_RESOLVE_FD , NUM_RESOLVE_FD --Action Reports , AR_NUM_CREATED , AR_NUM_CLOSED , AR_NUM_OPEN , COUNT_METTING_DUE_DATE , NUM_OPEN_IN_DUE_DATE --All Tickets , COUNT_DISPATCHED , NUM_AWAITING_DISPATCH , NUM_IN_JEOPARDY FROM ( --FMS SELECT DATE_DAY , CASE WHEN upper(ENTRY_TYPE) = 'ACTION REPORT' THEN (CASE WHEN PROBLEM_CATEGORY IS NULL THEN NULL WHEN PROBLEM_CATEGORY IN ('Compliance','Routine') THEN PROBLEM_CATEGORY ELSE 'Other' END) WHEN upper(ENTRY_TYPE) IN ( 'TROUBLE REPORT','NET REPORT' ) THEN (CASE WHEN SEVERITY IN ( 'Critical','Major' ) THEN SEVERITY ELSE 'Other' END) ELSE SEVERITY END AS SEVERITY , EQ_MARKET_CLUSTER --Performance , sum( C_NUM_DISPATCH_TO ) AS NUM_DISPATCH_TO , sum( C_DURATION_DISPATCH_TO ) AS DURATION_DISPATCH_TO , max( C_SLA_DURATION_DISPATCH_TO ) AS SLA_DURATION_DISPATCH_TO , max( C_SLA_DURATION_DISPATCH_TO_G_L ) AS SLA_DURATION_DISPATCH_TO_G_L , sum( C_NUM_DISPATCH_FROM ) AS NUM_DISPATCH_FROM , sum( C_DURATION_DISPATCH_FROM ) AS DURATION_DISPATCH_FROM , max( C_SLA_DURATION_DISPATCH_FROM ) AS SLA_DURATION_DISPATCH_FROM , max( C_SLA_DURATION_DISPATCH_FROM_G_L ) AS SLA_DURATION_DISPATCH_FROM_G_L , sum( NUM_CLOSED ) AS NUM_MTTR , sum( DURATION_MTTR ) AS DURATION_MTTR , max( SLA_MTTR ) AS SLA_MTTR , max( SLA_MTTR_G_L ) AS SLA_MTTR_G_L , NULL AS COUNT_CLOSED_MET_DUE_DATE , NULL AS NUM_CLOSED_MET_DUE_DATE --Costs , 0 AS OVERTIME , sum( NUM_CLOSED ) AS COUNT_NTF , sum( NUM_DISPATCH_NTF ) AS NUM_DISPATCH_NTF , NULL AS NUM_CTS_DISPATCH , NULL AS TICKET_NOT_DISPATCHED , 0 AS REMOTE_RESTORAL --Productivity , NULL AS NUM_TICKET_RATIO , NULL AS NUM_TECHS_RATIO , NULL AS NUM_DISPATCH_TICKET_RATIO --FMS , sum( C_NUM_DISPATCH_TO ) AS NUM_MET_DISPATCH_TO , sum( C_MET_SLA_DISPATCH_TO ) AS MET_SLA_DISPATCH_TO , sum( C_NUM_DISPATCH_FROM ) AS NUM_MET_DISPATCH_FROM , sum( C_MET_SLA_DISPATCH_FROM ) AS MET_SLA_DISPATCH_FROM , sum( NUM_CLOSED ) AS NUM_WIP , sum( DURATION_WIP_TO_RESOLVE ) AS DURATION_WIP_TO_RESOLVE , max( SLA_WIP_TO_RESOLVE ) AS SLA_WIP_TO_RESOLVE , max( SLA_WIP_TO_RESOLVE_G_L ) AS SLA_WIP_TO_RESOLVE_G_L , sum( NUM_CLOSED ) AS NUM_MET_WIP , sum( MET_SLA_WIP_TO_RESOLVE ) AS MET_SLA_WIP_TO_RESOLVE , sum( NUM_CLOSED ) AS NUM_MET_MTTR , sum( MET_SLA_MTTR ) AS MET_SLA_MTTR , sum( NUM_CLOSED ) AS COUNT_RESOLVE_FD , sum( NUM_RESOLVE_FD ) AS NUM_RESOLVE_FD --Action Reports , NULL AS AR_NUM_CREATED , NULL AS AR_NUM_CLOSED , NULL AS AR_NUM_OPEN , NULL AS COUNT_METTING_DUE_DATE , NULL AS NUM_OPEN_IN_DUE_DATE --All Tickets , sum( NUM_DISPATCH_FROM ) AS COUNT_DISPATCHED , sum( NUM_AWAITING_DISPATCH ) AS NUM_AWAITING_DISPATCH , sum( CASE WHEN upper(FORCE_STATUS) = 'JEOPARDY' THEN NUM_OPEN ELSE NULL END ) AS NUM_IN_JEOPARDY FROM CTS.dbo.NDC_Scorecard_Summary_Table t WHERE DATE_DAY >= cast(convert(varchar(8),getdate()-1,1) as datetime) AND DATE_DAY < cast(convert(varchar(8),getdate(),1) as datetime) AND ENTRY_TYPE IN ('Trouble Report') AND EQ_REGION IN ( 'NSD', 'NORTHEAST', 'CENTRAL', 'SOUTHEAST', 'WEST' ) AND EQ_MARKET_CLUSTER IN ( 'NEW ENGLAND','GEORGIA' ) AND SEVERITY IN ( 'Critical','Major' ) GROUP BY DATE_DAY , CASE WHEN upper(ENTRY_TYPE) = 'ACTION REPORT' THEN (CASE WHEN PROBLEM_CATEGORY IS NULL THEN NULL WHEN PROBLEM_CATEGORY IN ('Compliance','Routine') THEN PROBLEM_CATEGORY ELSE 'Other' END) WHEN upper(ENTRY_TYPE) IN ( 'TROUBLE REPORT','NET REPORT' ) THEN (CASE WHEN SEVERITY IN ( 'Critical','Major' ) THEN SEVERITY ELSE 'Other' END) ELSE SEVERITY END-- AS SEVERITY , EQ_MARKET_CLUSTER UNION --AR SELECT DATE_DAY , CASE WHEN upper(ENTRY_TYPE) = 'ACTION REPORT' THEN (CASE WHEN PROBLEM_CATEGORY IS NULL THEN NULL WHEN PROBLEM_CATEGORY IN ('Compliance','Routine') THEN PROBLEM_CATEGORY ELSE 'Other' END) WHEN upper(ENTRY_TYPE) IN ( 'TROUBLE REPORT','NET REPORT' ) THEN (CASE WHEN SEVERITY IN ( 'Critical','Major' ) THEN SEVERITY ELSE 'Other' END) ELSE SEVERITY END AS SEVERITY , EQ_MARKET_CLUSTER --Performance , NULL AS NUM_DISPATCH_TO , NULL AS DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO_G_L , NULL AS NUM_DISPATCH_FROM , NULL AS DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM_G_L , NULL AS NUM_MTTR , NULL AS DURATION_MTTR , NULL AS SLA_MTTR , NULL AS SLA_MTTR_G_L , sum( NUM_CLOSED ) AS COUNT_CLOSED_MET_DUE_DATE , sum( AR_NUM_MET_DUE_DATE ) AS NUM_CLOSED_MET_DUE_DATE --Costs , NULL AS OVERTIME , NULL AS COUNT_NTF , NULL AS NUM_DISPATCH_NTF , NULL AS NUM_CTS_DISPATCH , NULL AS TICKET_NOT_DISPATCHED , NULL AS REMOTE_RESTORAL --Productivity , NULL AS NUM_TICKET_RATIO , NULL AS NUM_TECHS_RATIO , NULL AS NUM_DISPATCH_TICKET_RATIO --FMS , NULL AS NUM_MET_DISPATCH_TO , NULL AS MET_SLA_DISPATCH_TO , NULL AS NUM_MET_DISPATCH_FROM , NULL AS MET_SLA_DISPATCH_FROM , NULL AS NUM_WIP , NULL AS DURATION_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE_G_L , NULL AS NUM_MET_WIP , NULL AS MET_SLA_WIP_TO_RESOLVE , NULL AS NUM_MET_MTTR , NULL AS MET_SLA_MTTR , NULL AS COUNT_RESOLVE_FD , NULL AS NUM_RESOLVE_FD --Action Reports , NULL AS AR_NUM_CREATED , NULL AS AR_NUM_CLOSED , NULL AS AR_NUM_OPEN , sum( NUM_OPEN ) AS COUNT_METTING_DUE_DATE , sum( NUM_OPEN_IN_DUE_DATE ) AS NUM_OPEN_IN_DUE_DATE --All Tickets , sum( NUM_DISPATCH_FROM ) AS COUNT_DISPATCHED , sum( NUM_AWAITING_DISPATCH ) AS NUM_AWAITING_DISPATCH , sum( CASE WHEN upper(FORCE_STATUS) = 'JEOPARDY' THEN NUM_OPEN ELSE NULL END ) AS NUM_IN_JEOPARDY FROM CTS.dbo.NDC_Scorecard_Summary_Table t WHERE DATE_DAY >= cast(convert(varchar(8),getdate()-1,1) as datetime) AND DATE_DAY < cast(convert(varchar(8),getdate(),1) as datetime) AND ENTRY_TYPE IN ('Action Report') AND EQ_REGION IN ( 'NSD', 'NORTHEAST', 'CENTRAL', 'SOUTHEAST', 'WEST' ) AND EQ_MARKET_CLUSTER IN ( 'NEW ENGLAND','GEORGIA' ) GROUP BY DATE_DAY , CASE WHEN upper(ENTRY_TYPE) = 'ACTION REPORT' THEN (CASE WHEN PROBLEM_CATEGORY IS NULL THEN NULL WHEN PROBLEM_CATEGORY IN ('Compliance','Routine') THEN PROBLEM_CATEGORY ELSE 'Other' END) WHEN upper(ENTRY_TYPE) IN ( 'TROUBLE REPORT','NET REPORT' ) THEN (CASE WHEN SEVERITY IN ( 'Critical','Major' ) THEN SEVERITY ELSE 'Other' END) ELSE SEVERITY END-- AS SEVERITY , EQ_MARKET_CLUSTER UNION --CTS SELECT CTS_DATE AS DATE_DAY , CASE WHEN SEVERITY IN ( 'Critical','Major' ) THEN SEVERITY ELSE 'Other' END AS SEVERITY , EQ_MARKET_CLUSTER --Performance , NULL AS NUM_DISPATCH_TO , NULL AS DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO_G_L , NULL AS NUM_DISPATCH_FROM , NULL AS DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM_G_L , NULL AS NUM_MTTR , NULL AS DURATION_MTTR , NULL AS SLA_MTTR , NULL AS SLA_MTTR_G_L , NULL AS COUNT_CLOSED_MET_DUE_DATE , NULL AS NUM_CLOSED_MET_DUE_DATE --Costs , NULL AS OVERTIME , NULL AS COUNT_NTF , NULL AS NUM_DISPATCH_NTF , sum( Closed_Tickets_External_NotDispatched + Closed_Tickets_NOC_NotDispatched ) AS NUM_CTS_DISPATCH , sum( Closed_Tickets_NOC_NotDispatched ) AS TICKET_NOT_DISPATCHED , NULL AS REMOTE_RESTORAL --Productivity , NULL AS NUM_TICKET_RATIO , NULL AS NUM_TECHS_RATIO , NULL AS NUM_DISPATCH_TICKET_RATIO --FMS , NULL AS NUM_MET_DISPATCH_TO , NULL AS MET_SLA_DISPATCH_TO , NULL AS NUM_MET_DISPATCH_FROM , NULL AS MET_SLA_DISPATCH_FROM , NULL AS NUM_WIP , NULL AS DURATION_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE_G_L , NULL AS NUM_MET_WIP , NULL AS MET_SLA_WIP_TO_RESOLVE , NULL AS NUM_MET_MTTR , NULL AS MET_SLA_MTTR , NULL AS COUNT_RESOLVE_FD , NULL AS NUM_RESOLVE_FD --Action Reports , NULL AS AR_NUM_CREATED , NULL AS AR_NUM_CLOSED , NULL AS AR_NUM_OPEN , NULL AS COUNT_METTING_DUE_DATE , NULL AS NUM_OPEN_IN_DUE_DATE --All Tickets , NULL AS COUNT_DISPATCHED , NULL AS NUM_AWAITING_DISPATCH , NULL AS NUM_IN_JEOPARDY FROM CTS.dbo.FMS_Daily_Summary_Regional WHERE CTS_DATE >= cast(convert(varchar(8),getdate()-1,1) as datetime) AND CTS_DATE <= cast(convert(varchar(8),getdate(),1) as datetime) AND upper( EQ_REGION ) IN ( 'NSD', 'NORTHEAST', 'CENTRAL', 'SOUTHEAST', 'WEST' ) AND EQ_MARKET_CLUSTER IN ( 'NEW ENGLAND','GEORGIA' ) GROUP BY CTS_DATE-- AS DATE_DAY , CASE WHEN SEVERITY IN ( 'Critical','Major' ) THEN SEVERITY ELSE 'Other' END-- AS SEVERITY , EQ_MARKET_CLUSTER UNION --Tickets Resolved per Tech SELECT DATE_DAY , ENTRY_TYPE AS SEVERITY , EQ_MARKET_CLUSTER --Performance , NULL AS NUM_DISPATCH_TO , NULL AS DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO_G_L , NULL AS NUM_DISPATCH_FROM , NULL AS DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM_G_L , NULL AS NUM_MTTR , NULL AS DURATION_MTTR , NULL AS SLA_MTTR , NULL AS SLA_MTTR_G_L , NULL AS COUNT_CLOSED_MET_DUE_DATE , NULL AS NUM_CLOSED_MET_DUE_DATE --Costs , NULL AS OVERTIME , NULL AS COUNT_NTF , NULL AS NUM_DISPATCH_NTF , NULL AS NUM_CTS_DISPATCH , NULL AS TICKET_NOT_DISPATCHED , NULL AS REMOTE_RESTORAL --Productivity , sum( NUM_OF_TICKETS ) AS NUM_CLOSED_TICKET_RATIO , sum( NUM_OF_TECHS ) AS NUM_CLOSED_TECHS_RATIO , 0 AS NUM_DISPATCH_TICKET_RATIO --FMS , NULL AS NUM_MET_DISPATCH_TO , NULL AS MET_SLA_DISPATCH_TO , NULL AS NUM_MET_DISPATCH_FROM , NULL AS MET_SLA_DISPATCH_FROM , NULL AS NUM_WIP , NULL AS DURATION_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE_G_L , NULL AS NUM_MET_WIP , NULL AS MET_SLA_WIP_TO_RESOLVE , NULL AS NUM_MET_MTTR , NULL AS MET_SLA_MTTR , NULL AS COUNT_RESOLVE_FD , NULL AS NUM_RESOLVE_FD --Action Reports , NULL AS AR_NUM_CREATED , NULL AS AR_NUM_CLOSED , NULL AS AR_NUM_OPEN , NULL AS COUNT_METTING_DUE_DATE , NULL AS NUM_OPEN_IN_DUE_DATE --All Tickets , NULL AS COUNT_DISPATCHED , NULL AS NUM_AWAITING_DISPATCH , NULL AS NUM_IN_JEOPARDY FROM CTS.dbo.vw_CLOSED_TICKET_TO_TECH_RATIO WHERE DATE_DAY >= cast(convert(varchar(8),getdate()-1,1) as datetime) AND DATE_DAY < cast(convert(varchar(8),getdate(),1) as datetime) AND EQ_REGION IN ( 'NSD', 'NORTHEAST', 'CENTRAL', 'SOUTHEAST', 'WEST' ) AND EQ_MARKET_CLUSTER IN ( 'NEW ENGLAND','GEORGIA' ) GROUP BY DATE_DAY , ENTRY_TYPE-- AS SEVERITY , EQ_MARKET_CLUSTER UNION --Tickets Resolved per Tech - Total SELECT DATE_DAY , 'Total' AS SEVERITY , EQ_MARKET_CLUSTER --Performance , NULL AS NUM_DISPATCH_TO , NULL AS DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO_G_L , NULL AS NUM_DISPATCH_FROM , NULL AS DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM_G_L , NULL AS NUM_MTTR , NULL AS DURATION_MTTR , NULL AS SLA_MTTR , NULL AS SLA_MTTR_G_L , NULL AS COUNT_CLOSED_MET_DUE_DATE , NULL AS NUM_CLOSED_MET_DUE_DATE --Costs , NULL AS OVERTIME , NULL AS COUNT_NTF , NULL AS NUM_DISPATCH_NTF , NULL AS COUNT_RFD , NULL AS NUM_CTS_DISPATCH , NULL AS TICKET_NOT_DISPATCHED --Productivity , sum( NUM_OF_TICKETS ) AS NUM_TICKET_RATIO , sum( NUM_OF_TECHS ) AS NUM_TECHS_RATIO , 0 AS NUM_DISPATCH_TICKET_RATIO --FMS , NULL AS NUM_MET_DISPATCH_TO , NULL AS MET_SLA_DISPATCH_TO , NULL AS NUM_MET_DISPATCH_FROM , NULL AS MET_SLA_DISPATCH_FROM , NULL AS NUM_WIP , NULL AS DURATION_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE_G_L , NULL AS NUM_MET_WIP , NULL AS MET_SLA_WIP_TO_RESOLVE , NULL AS NUM_MET_MTTR , NULL AS MET_SLA_MTTR , NULL AS COUNT_RESOLVE_FD , NULL AS NUM_RESOLVE_FD --Action Reports , NULL AS AR_NUM_CREATED , NULL AS AR_NUM_CLOSED , NULL AS AR_NUM_OPEN , NULL AS COUNT_METTING_DUE_DATE , NULL AS NUM_OPEN_IN_DUE_DATE --All Tickets , NULL AS COUNT_DISPATCHED , NULL AS NUM_AWAITING_DISPATCH , NULL AS NUM_IN_JEOPARDY FROM CTS.dbo.vw_CLOSED_TICKET_TO_TECH_RATIO WHERE DATE_DAY >= cast(convert(varchar(8),getdate()-1,1) as datetime) AND DATE_DAY < cast(convert(varchar(8),getdate(),1) as datetime) AND EQ_REGION IN ( 'NSD', 'NORTHEAST', 'CENTRAL', 'SOUTHEAST', 'WEST' ) AND EQ_MARKET_CLUSTER IN ( 'NEW ENGLAND','GEORGIA' ) GROUP BY DATE_DAY , EQ_MARKET_CLUSTER --AR Count SELECT DATE_DAY , 'All Severities' AS SEVERITY , EQ_MARKET_CLUSTER --Performance , NULL AS NUM_DISPATCH_TO , NULL AS DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO , NULL AS SLA_DURATION_DISPATCH_TO_G_L , NULL AS NUM_DISPATCH_FROM , NULL AS DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM , NULL AS SLA_DURATION_DISPATCH_FROM_G_L , NULL AS NUM_MTTR , NULL AS DURATION_MTTR , NULL AS SLA_MTTR , NULL AS SLA_MTTR_G_L , NULL AS COUNT_CLOSED_MET_DUE_DATE , NULL AS NUM_CLOSED_MET_DUE_DATE --Costs , NULL AS OVERTIME , NULL AS COUNT_NTF , NULL AS NUM_DISPATCH_NTF , NULL AS COUNT_RFD , NULL AS NUM_CTS_DISPATCH , NULL AS TICKET_NOT_DISPATCHED --Productivity , NULL AS NUM_TICKET_RATIO , NULL AS NUM_TECHS_RATIO , NULL AS NUM_DISPATCH_TICKET_RATIO --FMS , NULL AS NUM_MET_DISPATCH_TO , NULL AS MET_SLA_DISPATCH_TO , NULL AS NUM_MET_DISPATCH_FROM , NULL AS MET_SLA_DISPATCH_FROM , NULL AS NUM_WIP , NULL AS DURATION_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE , NULL AS SLA_WIP_TO_RESOLVE_G_L , NULL AS NUM_MET_WIP , NULL AS MET_SLA_WIP_TO_RESOLVE , NULL AS NUM_MET_MTTR , NULL AS MET_SLA_MTTR , NULL AS COUNT_RESOLVE_FD , NULL AS NUM_RESOLVE_FD --Action Reports , sum( NUM_CREATED ) AS AR_NUM_CREATED , sum( NUM_CLOSED ) AS AR_NUM_CLOSED , sum( NUM_OPEN ) AS AR_NUM_OPEN , NULL AS COUNT_METTING_DUE_DATE , NULL AS NUM_OPEN_IN_DUE_DATE --All Tickets , NULL AS COUNT_DISPATCHED , NULL AS NUM_AWAITING_DISPATCH , NULL AS NUM_IN_JEOPARDY FROM CTS.dbo.NDC_Scorecard_Summary_Table t WHERE DATE_DAY >= cast(convert(varchar(8),getdate()-1,1) as datetime) AND DATE_DAY < cast(convert(varchar(8),getdate(),1) as datetime) AND ENTRY_TYPE IN ('Action Report') AND EQ_REGION IN ( 'NSD', 'NORTHEAST', 'CENTRAL', 'SOUTHEAST', 'WEST' ) AND EQ_MARKET_CLUSTER IN ( 'NEW ENGLAND','GEORGIA' ) GROUP BY DATE_DAY , CASE WHEN upper(ENTRY_TYPE) = 'ACTION REPORT' THEN (CASE WHEN PROBLEM_CATEGORY IS NULL THEN NULL WHEN PROBLEM_CATEGORY IN ('Compliance','Routine') THEN PROBLEM_CATEGORY ELSE 'Other' END) WHEN upper(ENTRY_TYPE) IN ( 'TROUBLE REPORT','NET REPORT' ) THEN (CASE WHEN SEVERITY IN ( 'Critical','Major' ) THEN SEVERITY ELSE 'Other' END) ELSE SEVERITY END-- AS SEVERITY , EQ_MARKET_CLUSTER ) t
View Replies !
What's Wrong With My Statement? (simple)
Hello well-intentionned reader, I'm having trouble figuring out what's wrong with my statement. This is what the table looks like. I want to display employees under the manager with the last name King. my statements are below the tableName Null? Type ----------------------------------------- -------- ---------------------------- EMPLOYEE_ID NOT NULL NUMBER(6) LAST_NAME NOT NULL VARCHAR2(25) SALARY NUMBER(8,2) MANAGER_ID NUMBER(6) My statement SQL> SELECT last_name, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE EMPLOYEE.LAST_NAME = .King.); 2 3 4 5 6 WHERE EMPLOYEE.LAST_NAME = .King.) * ERROR at line 6: ORA-00936: missing expression Thank you for your time. /gozu
View Replies !
Whats Wrong With This Statement?
Query analyser is saying there is an error near the WHERE keyword: INSERT INTO EMPLOYEE_TABLE (BANK_ACC, SORT_CODE) VALUES (63035391,603030) WHERE 40 IN (SELECT EMPLOY_REF FROM EMPLOYEE_TABLE); Thanks people.
View Replies !
TSQL: Conditional Union Statement
Is it possible to have a conditional union statement in a stored proc?Here's an example on the northwind database. If says there's a syntaxerror near the UNION statement. Looks like it doesn't like having theBEGIN directly in front of it.Is the only solution to create a dynamic sql string then call exec onit?Any help appreciated.Tom.CREATE PROCEDURE usp_test(@both int = 1)ASSET NOCOUNT ONSELECT * FROM territories WHERE regionid = 1IF @both = 1BEGINUNIONSELECT * FROM territories WHERE regionid = 2ENDGO
View Replies !
Whats Wrong With My Join Statement?
The following sql statement is rejected by asp.net (working with sqlserver). It says something is wrong near "TableFlights". But I don'tsee anything wrong with it.Any help is appreciated:SELECT TableFlights.IdFlight, Concat = (TableFlights.OrganizerLastName+ ', ' + TableFlights.OrganizerFirstName + ' Flt:' +TableFlights.FlightNumber + ' on ' +Convert(char(10,TableFlights.FlightDate,101)) FROM TableFlights INNERJOIN TablePassengers ON TableFlights.IdFlight=TablePassengers.IdFlightWhere TablePassengers.Email = 'marvin@micro-net.com' Order ByTableFlights.OrganizerLastName, TableFlights.OrganizerFirstName-- Marvin
View Replies !
Whats Wrong With This Update Statement?
I wrote this update statement and it looks right but I keep getting an error that says "incorrect syntax next to c" what did I do wrong? Here is the statement: UPDATE tblclients c SET intproviderId = (SELECT TOP 1 t.inttransferid FROM tbltransfer t WHERE t.intclientids = c.intclientid ORDER BY t.inttransferid DESC)
View Replies !
TSQL: I Want To Use A SELECT Statement With COUNT(*) AS 'name' And ORDER BY 'name'
I am very new to Transact-SQL programming and don't have a programmingbackground and was hoping that someone could point me in the rightdirection. I have a SELECT statement SELECT FIXID, COUNT(*) AS IOIsand want to ORDER BY 'IOI's'. I have been combing through the BOL, butI don't even know what topic/heading this would fall under.USE INDIISELECT FIXID, COUNT(*) AS IOIsFROM[dbo].[IOI_2005_03_03]GROUP BY FIXIDORDER BY FIXIDI know that it is a simple question, but perhaps someone could assistme.Thanks,
View Replies !
Help With TSQL Statement To Check For Table Size
I have to deal with an environment where the developers create and modify tables at will, and the tool they use does not check if the table created is over the 8060 limit for a table. I have a sql statement below which checks the size for me, but I can't figure out how to put a where clause on it to check for the size being over 8060. I i have over 1000 tables to check and was going to write a cursor routine to check it and print it, but I need te where clause to work.Any help appreciated select Name=left(c.name,20), c.prec, scale = ISNULL(c.scale,0), t.name from syscolumns c inner join systypes t on c.xtype = t.xtype where id in (select id from sysobjects where name = 'mh_demographic2_') order by c.colid COMPUTE sum(c.prec)
View Replies !
My Update Statement Isn't Working But Select And Insert Are. What's Wrong?
here is my code: Dim cn As New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ToString()) cn.Open() Dim adapter1 As New System.Data.SqlClient.SqlDataAdapter() adapter1.SelectCommand = New Data.SqlClient.SqlCommand("update aspnet_Membership_BasicAccess.Products set id = '" & textid.Text & "', name = '" & textname.Text & "', price = '" & textprice.Text & "', description = '" & textdescription.Text & "', count = '" & textcount.Text & "', pictureadd = '" & textpictureadd.Text & "', artist = '" &textartist.Text & "', catergory = '" & textcategory.text & "' where id = " & Request.Item("id") & ";", cn) cn.Close() Response.Redirect("database.aspx") it posts and the page loads but the data is still the same in my datagrid. what could be wrong with this simple statement... i've tried testing the statement above with constant values of the correct type but i don't think that matters because the SqlCommand() accepts a string only anyways.. doesn't it?
View Replies !
Sql Server 2005 Inserting Prbblem..wrong SQL? Wrong Parameter?
Im trying to insert a record in my sql server 2005 express database.The following function tries that and without an error returns true.However, no data is inserted into the database...Im not sure whether my insert statement is correct: I saw other example with syntax: insert into table values(@value1,@value2)....so not sure about thatAlso, I havent defined the parameter type (eg varchar) but I reckoned that could not make the difference....Here's my code: Function CreateNewUser(ByVal UserName As String, ByVal Password As String, _ ByVal Email As String, ByVal Gender As Integer, _ ByVal FirstName As String, ByVal LastName As String, _ ByVal CellPhone As String, ByVal Street As String, _ ByVal StreetNumber As String, ByVal StreetAddon As String, _ ByVal Zipcode As String, ByVal City As String, _ ByVal Organization As String _ ) As Boolean 'returns true with success, false with failure Dim MyConnection As SqlConnection = GetConnection() Dim bResult As Boolean Dim MyCommand As New SqlCommand("INSERT INTO tblUsers(UserName,Password,Email,Gender,FirstName,LastName,CellPhone,Street,StreetNumber,StreetAddon,Zipcode,City,Organization) VALUES(@UserName,@Password,@Email,@Gender,@FirstName,@LastName,@CellPhone,@Street,@StreetNumber,@StreetAddon,@Zipcode,@City,@Organization)", MyConnection) MyCommand.Parameters.Add(New SqlParameter("@UserName", SqlDbType.NChar, UserName)) MyCommand.Parameters.Add(New SqlParameter("@Password", Password)) MyCommand.Parameters.Add(New SqlParameter("@Email", Email)) MyCommand.Parameters.Add(New SqlParameter("@Gender", Gender)) MyCommand.Parameters.Add(New SqlParameter("@FirstName", FirstName)) MyCommand.Parameters.Add(New SqlParameter("@LastName", LastName)) MyCommand.Parameters.Add(New SqlParameter("@CellPhone", CellPhone)) MyCommand.Parameters.Add(New SqlParameter("@Street", Street)) MyCommand.Parameters.Add(New SqlParameter("@StreetNumber", StreetNumber)) MyCommand.Parameters.Add(New SqlParameter("@StreetAddon", StreetAddon)) MyCommand.Parameters.Add(New SqlParameter("@Zipcode", Zipcode)) MyCommand.Parameters.Add(New SqlParameter("@City", City)) MyCommand.Parameters.Add(New SqlParameter("@Organization", Organization)) Try MyConnection.Open() MyCommand.ExecuteNonQuery() bResult = True Catch ex As Exception bResult = False Finally MyConnection.Close() End Try Return bResult End FunctionThanks!
View Replies !
TSQL Statement Extracting Data From One Table Through Another Table
Hi, I have 2 tables, MembersTemp and Organisations I'm trying to extract the organisation Name from the organisations table but am unsure of the sql statement to do this. Initiallt I only have the ExecID for the MembersTemp table MembersType table: ExecID 3013 OrganisationID 4550 Organisation table: ID 4550 (PK) Name "Microboff" Any ideas??
View Replies !
Equivalent Tsql For Sql Server 2000 Is Needed [from Sql Server 2005 Only Tsql]
Can anyone please give me the equivalent tsql for sql server 2000 for the following two queries which works fine in sql server 2005 1 -- Full Table Structure select t.object_id, t.name as 'tablename', c.name as 'columnname', y.name as 'typename', case y.namewhen 'varchar' then convert(varchar, c.max_length)when 'decimal' then convert(varchar, c.precision) + ', ' + convert(varchar, c.scale)else ''end attrib,y.*from sys.tables t, sys.columns c, sys.types ywhere t.object_id = c.object_idand t.name not in ('sysdiagrams')and c.system_type_id = y.system_type_idand c.system_type_id = y.user_type_idorder by t.name, c.column_id 2 -- PK and Index select t.name as 'tablename', i.name as 'indexname', c.name as 'columnname' , i.is_unique, i.is_primary_key, ic.is_descending_keyfrom sys.indexes i, sys.tables t, sys.index_columns ic, sys.columns cwhere t.object_id = i.object_idand t.object_id = ic.object_idand t.object_id = c.object_idand i.index_id = ic.index_idand c.column_id = ic.column_idand t.name not in ('sysdiagrams')order by t.name, i.index_id, ic.index_column_id This sql is extracting some sort of the information about the structure of the sql server database[2005] I need a sql whihc will return the same result for sql server 2000
View Replies !
Multiple Tables Used In Select Statement Makes My Update Statement Not Work?
I am currently having this problem with gridview and detailview. When I drag either onto the page and set my select statement to pick from one table and then update that data through the gridview (lets say), the update works perfectly. My problem is that the table I am pulling data from is mainly foreign keys. So in order to hide the number values of the foreign keys, I select the string value columns from the tables that contain the primary keys. I then use INNER JOIN in my SELECT so that I only get the data that pertains to the user I am looking to list and edit. I run the "test query" and everything I need shows up as I want it. I then go back to the gridview and change the fields which are foreign keys to templates. When I edit the templates I bind the field that contains the string value of the given foreign key to the template. This works great, because now the user will see string representation instead of the ID numbers that coinside with the string value. So I run my webpage and everything show up as I want it to, all the data is correct and I get no errors. I then click edit (as I have checked the "enable editing" box) and the gridview changes to edit mode. I make my changes and then select "update." When the page refreshes, and the gridview returns, the data is not updated and the original data is shown. I am sorry for so much typing, but I want to be as clear as possible with what I am doing. The only thing I can see being the issue is that when I setup my SELECT and FROM to contain fields from multiple tables, the UPDATE then does not work. When I remove all of my JOIN's and go back to foreign keys and one table the update works again. Below is what I have for my SQL statements:------------------------------------------------------------------------------------------------------------------------------------- SELECT:SELECT People.FirstName, People.LastName, People.FullName, People.PropertyID, People.InviteTypeID, People.RSVP, People.Wheelchair, Property.[House/Day Hab], InviteType.InviteTypeName FROM (InviteType INNER JOIN (Property INNER JOIN People ON Property.PropertyID = People.PropertyID) ON InviteType.InviteTypeID = People.InviteTypeID) WHERE (People.PersonID = ?)UPDATE:UPDATE [People] SET [FirstName] = ?, [LastName] = ?, [FullName] = ?, [PropertyID] = ?, [InviteTypeID] = ?, [RSVP] = ?, [Wheelchair] = ? WHERE [PersonID] = ? ---------------------------------------------------------------------------------------------------------------------------------------The only fields I want to update are in [People]. My WHERE is based on a control that I use to select a person from a drop down list. If I run the test query for the update while setting up my data source the query will update the record in the database. It is when I try to make the update from the gridview that the data is not changed. If anything is not clear please let me know and I will clarify as much as I can. This is my first project using ASP and working with databases so I am completely learning as I go. I took some database courses in college but I have never interacted with them with a web based front end. Any help will be greatly appreciated.Thank you in advance for any time, help, and/or advice you can give.Brian
View Replies !
Using Conditional Statement In Stored Prcodure To Build Select Statement
hiI need to write a stored procedure that takes input parameters,andaccording to these parameters the retrieved fields in a selectstatement are chosen.what i need to know is how to make the fields of the select statementconditional,taking in consideration that it is more than one fieldaddedfor exampleSQLStmt="select"if param1 thenSQLStmt=SQLStmt+ field1end ifif param2 thenSQLStmt=SQLStmt+ field2end if
View Replies !
TSQL Or SQL CLR?
Hello Friends, I am not sure if this is the right place to post this question but if not please suggest me when it can be posted. I have been thinking of writing Stored procs in SQL CLR/ changing all of my Stored Procs to SQL CLR. Is there any thing that I need to keep in mind about the size of the sotred proc (like calculation intensive) before I do that? I mean can even change a TSQL stored proc which is relatively small Stored Proc, that simply said Select * from Customers to SQL CLR? or the SQL CLR does only useful/makes difference with calculation intensive stored procs and big stored procs? When I talked to our Architects they said every small sized stored proc can be written using SQL CLR and more over forget about the classic TSQL stored procs and get used to write SQL CLR when ever writing any database related stuff. And also there are so many articles that discussed about the advantages of SQL CLR over the TSQL but I would appreciate if some one could put few bulletted points why do you think SQL CLR is more powerful. Please advise.Thanks in advance,-L
View Replies !
TSQL Please Help
Hi I am creating some dynamic sql by passing variouse parametrs to my Stored Procedure. One of my Parameters is string has lots of values seperated by a comma to help build an 'IN' statement. SET @SQL = 'SELECT * FROM areas'SET @p1 = '10,20'If @p1 IS NOT NULLBEGINSET @sSQL = @sSQL + ' WHERE (Areas IN (''' + Replace(@p1,',',''',''') + '''))'END The above query runs perfecly well in Query Analyser, however when I put it into my ASP.NET application I get an error of "Error converting data type varchar to numeric." So I think I need to do some sort of casting or Converting but im not sure how to do it. Or do I need to use a INSTRING? I did manage to work out a method by using the follwoing SELECT * FROM Areas WHERE PATINDEX('%,' + CAST(ArType AS VARCHAR) + ',%',',' + @p1 + ',') > 0 But I cant seem to convert the above line into coherent dynamic statement. My feeble attempt is below but I keep getting errors SET @sql = @sql + ' WHERE PATINDEX(''%,'' + CAST(ArType AS VARCHAR) + '',%'','','' + @p1 + '','') > 0' IM strugging to understand all the '''. My TSQL is pretty basic, any help would be much appreciated Many thanks in advance
View Replies !
TSQL Help
A stored procedure was running slowly so I took the code, removed thesubselect and included a join, then took the max and included as partof a correlated subquery.The result is below, however, this is no improvement over the original.An advice would be greatly appreciated.SELECT FSALT.FUNDING_LINE_TYPE_ID,A.PAYMENT_PERIOD_ID,A.CASH AS CASH,A.VOLUME AS VOLUMEFROM ACTUALS AINNER JOIN (SELECT MAX(COLLECTION_PAYMENT_PERIOD_*ID) AS CPP FROMACTUALS ACT WHERE COLLECTION_PAYMENT_PERIOD_ID<=*456) AS O ON O.CPP =A.COLLECTION_PAYMENT_PERIOD_IDINNER JOIN FS_ACTUAL_LINE_TYPES FSALT ON FSALT.FS_ACTUAL_LINE_TYPE_ID =A.FS_ACTUAL_LINE_TYPE_IDINNER JOIN PAYMENT_PERIODS PP ON PP.PAYMENT_PERIOD_ID =A.PAYMENT_PERIOD_IDWHEREA.ORG_ID=24771AND A.LSC_ORG_ID=5816AND PP.FUNDING_STREAM_ID=5AND PP.FUNDING_PERIOD_ID=6GROUP BYFSALT.FUNDING_LINE_TYPE_ID,A.PAYMENT_PERIOD_ID, A.CASH, A.VOLUME
View Replies !
TSQL Help
I need help with a query that I want to incorporate into a scheduled DTS within SQL Server 2000. I have a process that brings in records from an Excel file, compares that day's records with any related information already stored in the database, then saves a table of joined records. This leaves me with any matches to the data. I need to filter out all but the most current record, which would be identified by a column named [DATE]. Ex: Table tblMatchedRecords M BLah Blah2 [DATE] 1 this that 20040101 2 this them 20040102 3 this that 20040630 In this example, I would like to have the record with [DATE] = 20040630 kept, and the others deleted. All columns do not always have to match exactly. I want to be able to specify which fields that need to match and pull only the latest date. Make sense? Can anyone offer any suggestions?
View Replies !
TSQL Help
I need help with a query that I want to incorporate into a scheduled DTS within SQL Server 2000. I have a process that brings in records from an Excel file, compares that day's records with any related information already stored in the database, then saves a table of joined records. This leaves me with any matches to the data. I need to filter out all but the most current record, which would be identified by a column named [DATE]. Ex: Table tblMatchedRecords M BLah Blah2 [DATE] 1 this that 20040101 2 this them 20040102 3 this that 20040630 In this example, I would like to have the record with [DATE] = 20040630 kept, and the others deleted. All columns do not always have to match exactly. I want to be able to specify which fields that need to match and pull only the latest date. Make sense? Can anyone offer any suggestions?
View Replies !
Tsql Help
I have a few variables declared @amount=100000 (any big int) @pamount=100000 @a1,@a2 - thorugh @25 -- each a bigint @p1,@p2,@p3 @id - int if @id is an odd number I need to randomly change @amount-@a1 (randomly to @a1 - @a25 so it ends up being any of 25 values) and then @pamount randomly= to either @p1,@p2 or @p3 Can someone help me do the sql for this? it will be within my stored procedure
View Replies !
TSQL Help...please
I am trying to determine concurrency of a program running based on start and stop times. Right now I have 8863 records to compare, but here is a small sample. Start Time Finish Time 1)2003-12-01 00:31:12.0002003-12-01 01:14:23.000 2)2003-12-01 06:55:43.0002003-12-01 15:50:47.000 3)2003-12-01 07:19:12.0002003-12-01 16:30:06.000 4)2003-12-01 07:22:10.0002003-12-01 15:56:44.000 5)2003-12-01 07:27:46.0002003-12-01 18:36:05.000 6)2003-12-01 07:34:53.0002003-12-01 09:57:15.000 I need to compare the times for overlap to determine concurrency. For instance: Comparing record 1 to record 2: If record1.starttime <= record2.finishtime AND record1.finishtime >= record2.starttime, then count = 1, esle 0 If record1.starttime <= record3.finishtime AND record1.finishtime >= record3.starttime, then count = 1, else 0 AND SO ON AND SO ON... when you encounter a 0, SUM the count as Concurrent. Then, I need it to move to record to and do the same thing... Comparing record 2to record 1: If record2.starttime <= record1.finishtime AND record2.finishtime >= record1.starttime, then count = 1, esle 0 Comparing record2 to record 3: If record2.starttime <= record3.finishtime AND record2.finishtime >= record3.starttime, then count = 1, else 0 AND SO ON AND SO ON... when you encounter a 0, SUM the count as Concurrent. Finally, when the loop (or cursor??) is finished, select MAX(count) as maximum concurrency. I tend to stay more on the system side and less on programming so I am really out of my realm. Any help polishing off the logic, and some pointers on how to write this in T-SQL would be much appreciated. Thanks in advance. Ryan Hunt
View Replies !
TSQL Help
Hi, I am trying to break up a column "name" into 2 columns "first name" and "last name". The name colum is currently "lastname, firstname". Is there an easy way to do this in SQL 6.5? I successfully extracted the first name using: firstname = rtrim(substring(name, (charindex(',', name)), 25)) But I am having trouble doing the lastname. Please help. Thanks so much! Laura
View Replies !
TSQL ?
I am using the following statement to do an extract for a data security matrix. I can get the select to work, but not the insert . Any help appreciated. set nocount on declare @dbname varchar(30) declare @sqlperm varchar(50) declare @objname varchar (50) declare @secgroup varchar (50) declare @printline varchar(80) declare @sql varchar(255) declare @sql1 varchar(255) if @dbname is NULL begin declare dbcursor cursor for select name from master..sysdatabases where name not in ('master','msdb','pubs','model','northwinds') open dbcursor fetch next from dbcursor into @dbname while (@@FETCH_STATUS <> -1) begin select @dbname, case spt.action when 26 then "REFERENCES " when 193 then "SELECT " when 195 then "INSERT " when 196 then "DELETE " when 197 then "UPDATE " when 224 then "EXECUTE " end , so.name , (select su.name from ois..sysusers su where su.uid = spt.uid) from ois..sysobjects so join ois..sysprotects spt on so.id = spt.id where so.type in ("P","U","V") select @sqlperm = case spt.action Select @sqlobject = so.name select @sqlgroup - su.name insert into bsrdict..tbl_sql_sec values (@dbname @sqlperm, @sqlobject,@sqlgroup) fetch next from dbcursor into @dbname end close dbcursor deallocate dbcursor end
View Replies !
TSQL
I'm new in T-SQL... Is there way I can do loops in SQL? I’m trying to do something like: "for each a.description in account_codes a where clientId in(1,0) select b.balance from account_balance b"..... Right now I'm trying to execute this: "select a.description,b.balance from account_balance b, account_codes a where a.clientid in (1,0)" the result that I get is: description balance -------------------- --------------------- A income 123.1200 A income 235.1200 B income 123.1200 B income 235.1200 but what I want to see is: description balance -------------------- --------------------- A income 123.1200 B income 235.1200 Any help will be greatly appreciated... Thank you, Nastya.
View Replies !
|