I've got a table which contains a series of dates (the columns are client_id, start_date and end_date). I need to calculate the number of working days between the start and end dates. This cou...
I would like to query the following based on the current date 07/29/2008
Start Date and End Date for Last Week (if current date is 07/29/2008, then between 07/20/2008 - 07/26/2008)
Start D...
I have a sql string here that is not running correctly. I am trying to concatenate 2 fields, referrer and the count of the cases, into one field to display in a drop down list. Something is wr...
Hello!
I have two tables as shown below.
As you can see for each version the column_id may have a different column name. So 1 = Supplies for version 1 and 1 = Other for version 2.
In the da...
I have a table that looks like this:
CarID CarName CarColor
------- ----------- -----------
car10 Infany Blue
car11 ja...
Hello I am tring to add a user to all of my DB's named HTML_ howerver I am getting a syntax error Msg 102, Level 15, State 1, Line 30
Incorrect syntax near ''-
Here is the Query
Decla...
Hello, how do you remove non-numeric characters from a column.
for example: (111) 333-3333 needs to be 1113333333
Hi all,
I want to use IIF function in the select statement ie:
Seclect field1, iif(field1 = 0, field2, field3) as ResultField, iff(field4 = 0 , 'capital', 'city') as textfield
from atabl...
Dear Experts,
Is it possible to search all fields' content in a database for specific word?
for ex. I want to search a word about 'London City abc'
the query will search all fields in all...
Hello:
I am using the following query as a view to retrive records:
TOP 100 PERCENT ad_adno, ad_code, ad_rep, ad_contact + ' - ' + ad_addr_0 AS contact
FROM OPENQUERY(mysql, 'sele...
I want to make a Sales table in SQL. I have an equipment table which shows the equipment available for hire, and also a table which shows the currently hired items and their due dates. I want ...
I'm running a VBScript that connects to an ODBC data source. The database, in this instance, is on a SQL 2000 server.
I have chosen to use ODBC and to execute an SQL command as I will be ru...
Need help with the REPLACE command. After running this SELECT :
SELECT CATEGORY, QTY_STK, ACTIVE
FROM ITEMS
WHERE (CATEGORY = '166') AND (QTY_STK = 0) AND (ACTIVE = 'T')
...
Im having some problems with this one... I need a report that generates a list of the last 12 months (from today, i.e. Sept 07 - Aug 08), then using a column of dates from a table, count how ...
Hi
I want to use an IF statement to check if a SELECT statement returns values. If the SELECT returns values I want to do one thing, and if it does not return any values I want to do anothe...
Hi,
What do I need to do to the following Access code to convert to using SQL Server 2005?. I have got so far but am now stuck with the INSERT statement parameters & on adding the current...
hI,
I have the following line of code in a VB6 project
SQLStmt = " INSERT INTO Recipes_West_Table " & _
"Values( " & Form1.Text1.Text & " , " Form1.txtVal1.Text & "," & Label2.Caption...
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 ...
Hello,
I am trying to implement the following Trigger into a table in SQL Server 2005
http://jamesewelch.wordpress.com/2007/09/04/tracking-database-record-changes-at-the-field-level/
I...
I would like to convert a date time field to a string . example the string should look like this
08/26/2008 10:30:26
Hello!
About my environment:
I have a hosted web database that I don't have access to other than with classic ASP and an ODBC connection that thankfully gives me both read and write access...
I always want to Round UP no matter what decimal is returned. Example: 369.2 will be 370 just like 369.7 will be 370.
I can't figure out the syntax for DROP and CREATE statement in a SQL Server 2005 Stored Procedure.
I want to store the Stored Procedure in another location so that when I EXECUTE it in a ne...
We've been working on hardening our web site which is written in .asp and uses SQL 2000 on the back-end. We've had a few SQL injection attacks and we're trying to decode what is being passed....
I have a file on the server called import.csv. I need to import all of the contents into a mysql called cbacks. I cannot get this code to work. I have included the PHP code as well as a cop...