I want to show distinct entries that occur in a field in a combo box. I am using the following statement
SELECT [all].[date recorded] FROM [all] ORDER BY Mid([date recorded],7,4) DESC , Mid(...
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 ...
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...
What is the difference in the Order by and Group by syntax?
I am trying to concatenate the rows of one column into one string but for some reason my query never finishes executing. It looks like it's going in an infinite loop.
Here's how the source ...
I am using T-SQL , sql server 2005
I have two timestamp fields, I need to calculate the difference between the two
Example
If CreatedDateTime = 2008-08-17 22:20:10.993 and ProcessTime = 20...
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 this script:
IF A = 1 THEN
CREATE TRIGGER ABC ON TABLE DEF ...
ELSE
CREATE TRIGGER ABD ON TABLE DEF ...
END IF;
It is an install script run from SQLPLus and off course do...
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'm trying to filter a DataGridView using a filter based on the text entered into a Text Box. The SQL Server Query looks like
SELECT *
FROM <TableName>
WHERE (<Tabl...
Below is my query which ranks a value. How do I make it return the percentile. I am using Access 2003.
SELECT tblA.RC1, tblA.RC2, tblA.RC3, tblA.[4], (Select Count (*) from tbl19complete W...
I need to design a T-SQL query for a MS SQL 2000 database which can retrieve the following information from a table: TripID, PickUpDate, DriverID, and number of times that the driver has drive...
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...
Howdy
I'm trying to create a prepare statement in order to speed PHP-based queries up. The idea is to create the prepared statement at the server and execute from PHP, however, I'm getting...
Hi there,
I hope you can help, I am having a headache with an SQL query.
I have written the query shown below and everything works well but the substring is returning a NULL value. I hav...
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...
I want to load the top 100 records when a form in vb2005 loads. There are about 5006 records in this table but it will load too slowly if all of the records have to load at one time.
I have t...
I am new to SQL triggers, and need to write one for when a new record is added to a table.
I have two tables, say, TableA and TableB. The trigger will be on TableB.
When a new record ...
I'm trying to develop a CASE statement but I can't get it right. I want to evaluate the following SELECT statement:
SELECT `rate` FROM `rates` WHERE `project` = 105 AND `category` = 'JrPart...
Hi,
I have a table T1 with fields A,B,C,D,E,F
A is a bigint PK created by an identity starting at 1
Some records have identical vaules in C,D,E
In these situations i wish to remove all b...
I am looking for a script that I can use to determine the size of data in a particular column. For example, say that I have a table that has an ID and MyName Column:
CREATE TABLE MyTable (M...
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 ...
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...
if i have a string like this "212.213.214.215"
how do i split it into 4 variables? i mean split it at the . period
Thanks
I need to write a stored procedure that will check the first 5 and last 6 charcters of a string. If the first 5 characters = '<div>' and the last 6 = '</div>' i need to remove them from the s...