I am trying to convert mssql triggers to mysql. I am very new to Mysql and would like some help with my code. My queries work but there has to be a more efficient way to write them. I would greatly appreciate any help. the following is a trigger that works until I add the last update statement. thanks for the help.
Mysql 5
[code=Mysql]
delimiter //
Create TRIGGER User_Rating_Avg After Insert on bksite.Ratings...
User Profile
Collapse
-
silversubey started a topic MYSQL trigger You can't specify target table 'XXX' for update in FROM clausein MySQLMYSQL trigger You can't specify target table 'XXX' for update in FROM clause
-
cannot sum specific variables
Hello all.
I have a form that users are able to enter dollar amounts for each month and add them to the table. i am having difficulty adding cells that display the totals. For example, rows have 12 columns(one for each month) I would like to have a 13th that totals the entire row. Also at the bottom of the table, i need to have a total for only that column. I hope this makes sense. Below is the code for one of the tables.
[code=php]... -
Works perfect!
Thank you for the help. -
Query from two tables that looks for a missing value
Hello,
I have two tables: CltDue, Checklist
SELECT CltDue.CDClient name, CltDue.CDID
FROM CltDue
WHERE CLtdue.CDstatus = 'More Client info reqst'
shows the following:
project#1 9579
project#2 9956
project#3 9946
SELECT checklist.CDID, Checklist.page
FROM Checklist
shows the following
9579 CLS
9579 INFO... -
I was able to get this to work woth the following code. If it lokos sloppy, please let me know how to fix it.
SELECT CltBudget.CBudC ltName AS Client
, SUM(CltBudget.C Budfee) AS 'Total Dollars'
, SUM(CltBudget.C Budhours) AS 'Total Hours'
, COUNT(CltBudget .CBudDueID) AS 'Project Count'
, SUM(CASE MONTH(CltDue.CD Target) WHEN 1 THEN CltBudget.CBudH ours ELSE 0 END) AS 'January'
, SUM(CASE MONTH(CltDue.CD Target)...Leave a comment:
-
Using SUM in Query to total hours based on Months.
I am using a query to total hours (Cltbudget.CBud hours) and dollars (CltBudget.CBud Fee) Grouped by client names (Cltbudget.CBud CltName).
here is the Query:
SELECT CltBudget.CBudC ltName AS Client
, SUM(CltBudget.C Budfee) AS 'Total Dollars'
, SUM(CltBudget.C Budhours) AS 'Total Hours'
FROM VPM.dbo.CltBudg et CltBudget, CltDue
WHERE CltBudget.CBudD ueID = CltDue.CDID AND ((CltDue.CDTarg et Between '01-01-2007'... -
Thanks for the help.
the hyperlinks are structured based on cell values within the spreadsheet.
I'm not sure how to put that in the macro. I'll keep trying and post if it works.Leave a comment:
-
Need help with Hyperlink in excel
Hello All
I have an Excel 2003 worksheet that has a column of hyperlinks that point to a web-based program. The hyperlinks are dynamic and work fine. Is it possible to have Excel use Firefox to launch the hyperlinks without making it the default internet program?
Thanks.Last edited by Killer42; Nov 9 '07, 01:15 AM. -
-
Column or Field variable for an Excel query.
Hello all.
I have an excel query that pulls data from a SQL database. I have 2 parameters that represent the [start] and [end] of a between criteria. Here is the query.
SELECT CltDue.CDClient Name
, CltDue.CDEventD esc
, CltDue.CDDescri ption
, (empfname)+' '+(emplname)
, CltDue.CDTarget Amount
, CltDue.CDTarget Hours
FROM VPM.dbo.CltDue CltDue, VPM.dbo.Employe e Employee
WHERE CltDue.CDInChar ge... -
my form has a simple submit button to save the data
<input type="submit" value="Save">
by using onbeforeunload I get the prompt "You are leaving the page....Are you sure you want to navigate away". "OK" or "Cancel"
Is it possible to have it say "you are leaving the page....do you wish to save this page before leaving." and when they...Leave a comment:
-
Thanks for the info. I am now able to warn them at least. Has anyone seen it where the save function can be in the prompt?Leave a comment:
-
Save Prompt for PHP form?
I have a php based checklist that stores the answers to MSSQL. Currently it has a save button at the bottom of the page that no one uses. When they exit the page without pressing save no data is recorded. Is it possible to have a prompt that would ask to save, when they try to leave? Any is help is appreciated. thanks -
Got it.
I added an IF
Here is the code I have if anyone needs
-- Drop the trigger if it already exists
IF EXISTS(
SELECT *
FROM dbo.sysobjects
WHERE id = object_id(N'[reviewntc]') AND
OBJECTPROPERTY( id, N'IsTrigger') = 1)
DROP TRIGGER [reviewntc]
GO
-- Create the trigger
CREATE TRIGGER reviewntc
...Leave a comment:
-
I'm sorry, but I am new to SQL.
Where and how do I insert CHECKLeave a comment:
-
Help with UPDATE trigger
I am trying to setup a trigger that sends an email if a field is changed to specific data. The trigger works when ever the field is changed, but I only need an email if the field is changed to 'In Review'
Any help is greatly appreciated.
-- Create the trigger
CREATE TRIGGER reviewntc
--indicate which table the trigger is to be executed on
ON CltDue
--indicate that this an UPDATE... -
thankyou very much for your help.
The Query works if I leave off the Distinct. What is Distinct?
Also, my text colum "TimeEntry.TEre f" only displays (MEMO) I will check this out further.Leave a comment:
-
Thankyou for the reply.
Does !='None' mean not equal to None?
I am now getting a text,ntext, image type..... error
I researched and found that 1 of the columns i need data from is a "text" column. All I can find to do is recreate the column "varchar" but the problem is there is data in that column. Any suggestions? thankyou for all of your help.
EDIT
the error that I am getting...Leave a comment:
-
Need help with converting Access Query to MSDE
I have a query that works in Access. It pulls time in a format that is understood by Quickbooks. We are upgrading our access-based program to MSDE. I have tried 3rd party converters and searched Google, but I still cannot get the proper syntax down. I am posting my access query in SQL view.
SELECT
([Empfname] & " " & [Emplname]) AS Employee
,TimeEntry.TEda te
, IIf([Engrelated]<>"None",([Engrelated]... -
Correction from my earlier reply. This does the same result but with less expression.
Field: IIf([Column1]<>"",([Column1] & ":" & [Column2]),([Column2]))Leave a comment:
No activity results to display
Show More
Leave a comment: