I have a table:
data_table
subject year totaltested
I want to change this query:
SELECT
subject,
year
FORMAT(SUM(totaltested), 2) AS total,
FROM data_table
...
Hi All, I have two SQL Statements that I am really hoping to combine to extract some infromation from out CRM package.
The first statement retreives a list of companies that we have not ha...
I have to add 511 blank spaces into a sql query that outputs to a file. The file has to have each query line show up in exactly the right character spot. I have to create blank spaces for the ...
I'm trying to make my dynamic SQL sort work. I'm sorting by 3 values but the second one's sort order (asc/desc) depends on an input parameter. It all works except for when the second value's...
i want to take this query:
SELECT * , count( media_id ) AS songs_in_fav
FROM `jamroom_user_favorites`
GROUP BY user_id
ORDER BY songs_in_fav DESC
and use the data in column 'songs_in_...
I have a proc p_GetData that is invoked by many other procs,
A temporary table is passed to the proc p_GetData as a paramater, @TableName
I would like to know if a particular column exi...
Looking for a little help writing a bit of SQL.
I'm trying to run something that looks a bit like the snippet below to get output about the seqs for associated with several different tables...
I am using T SQL (MSSQL Server 2005)
I am trying to write a dynamic query in a stored procedure but I am not getting the desired output
For tesing I have commented out the following li...
REF is a Text field in Table1
In Query1 - Calculated field --- > Test_Field: IIf([REF]="K","other",IIf(CInt([REF])=1,"One",IIf(CInt([REF])=7,"Seven",IIf(CInt([REF])=12,"Twelve",IIf(CInt([REF]...
Just a side comment as it was unusual syntax for me. I noted in the inline views used in the solution by ee_rlee on the related question, that they were brackets used with a period []. versus...
Can someone tell me what this does in mysql? Specifically the last line which starts with KEY? I assumed it would index the two specified columns, however in the desc command output, only one ...
Here's a tough one:
For the US among others the decimal symbol is a dot. Many countries, mine with them, is using a comma instead. Now, when performing an SQL query with a decimal number as a...
I need to create a job to clean up some data every night. I need to do a select statement (that joins multiple tables) and then loop through each record and do an update to one of the related...
What is the general method to incorporate an SQL script (.sql file) into an Excel VBA module? At this point, I have to run the SQL script using SQL*XL to get the data into an Excel worksheet. ...
I am new to SQL server 2005 and I need to create a stored procedure to do the following:
I pass a unique reference [MyID] that returns a single record. from the table. This contains the follo...
I have a SQL database table that has some data in it. I need to update one of the columns, so that they all be a fixed length of 3, with leading zeroes. So if I have 15 it will be 015, and i...
I have a large database with a very key table (Tbl_General) that lots of people can update. I need to record all changes done by whom, and when. I do NOT need to worry about Inserts because ...
Hi,
I seem to be making a mistake in a subquery routine for MS Access. If I start with this:
SELECT t.employee, t.project, t.subproject, t.phase, t.notes, Sum(t.duration) AS hours, emplo...
I have an SQL requiring an inner join. The hitch is for table A the join condition (ON clause) is part of a string. Specifically I want to make a join looking similar to this...
"from tab...
I have three tables in sql server database. Table1 as:
CREATE TABLE [IA_report] (
[report_id] [int] IDENTITY (1, 1) NOT NULL ,
[report_yr] [smallint] NOT NULL ,
[report_nbr] [smallint]...
Experts
I am looking to finalise a SQL query which should present a subset of data from an initial query which is based upon an outer join on 2 tables.
The second query should return the...
I would like to find the 'count' of the field 'QCReportNo' and save it in a variable.
I've attached my code but can't even get it to compile. I get the error...
Wrong number of argument...
I am using SQL Server 2000 and I have created a user defined function named TT_GET_MARKUP2. The select statement of the function works in Microsoft's SQL Query Analyzer, but when I try to cre...
I have a sql 2000 server running as default on port 1433, however I need to change it to a named instance - how do I do this? Help I'm in trouble!!
Cheers
How would I obtain the year from the current date rather than forcing 2007 in the following view when I create it?
Thanks!