Hi,
i am using SQL 2005 Express.
I want to have a query result like below:
Day Jan 2008 Feb 2008 Mar 2008 .........................Dec 2009 and so on.
1
2
3
.
.
.
...
I have a union query in MS Access where it is outputing the results of 5 different queries. Some of these outputs are dollar values and some are number counts.
The first problem is that al...
i have this query this out?
declare @intyear_number as int
set @intyear_number = 32
declare @sql as varchar(1000)
set @sql = 'select * from table1 where year = ' + @intyear_number
exec(@...
I have a date/time field. However, in my Select query I would only like to display the TIME.
Looking to retrieve all values between records listing AA-1 through AA-96 (ie. between "AA-1" and "AA-96"). Since its not a whole number, I assume it won't retrieve the exact values I'm lookin...
In SQL How do I calculate the running totals on a field straight after (ie withingt the same sql function) it has been summed or counted. See attached example
I'm building an update query that will convert the format of data from one field into a new field so that the original can be deleted. This is to make my table more efficient. I am working in ...
Hi all
im not to sure how to do this so hope somone can help
i have a query SELECT id, parentID, etc FROM table WHERE parentID = value
but what im trying to do is also find out if a...
I have a DATEDIFF statement that I want to use a COALESCE in instead of a CASE.
For Example:
SELECT
oh.CustomerNo
,datediff(day, case oh.OrderStatus
when 'QS' then oh.OrderAPPRejDa...
I have an xml file trying to read the fields for this xml to update a table
I am having problems reading
<AgingDetail>
<AgingIneligible>
nodes can anyone tell me how to read these...
Hi!
I'm creating a stored procedure, that will accept a value from a user, check against one table and then copy corresponding rows from that table into another.
I've made the procedure,...
I'm using UTL_FILE.PUT_LINE and I either get the last record only or I get all of the records on one row instead of one row for each record. See example:
v_piece := v_id_number || CHR(9) ||...
Writing SQL on a Sybase database and a few of my sub-queries require Group By and Having clauses.
Because I must retrieve my product ID from a table based on prodCode, I am forced to join two...
i have a table called dbo.AbcTable where i have sixteen different columns with different data types. One of the column is RuleNumber varchar(40) null. This has different rule numbers i want to...
Guys and Gals,
I am trying to create a new user function within Sql 2000. Basically I have a table called 'ItemPrice'. It lists the item, effectivedate and itemprice. There will be mu...
I have a column in one of my access tables that I use populate a combobox in an access form. The problem is I column has null entries in it which when opening the combobox connected to that co...
The following query returns an error saying that I have invalid syntax near ' ' at line 1. The basics of this is:
I have a stock_history table that stores historical stock prices, a stock ...
Hi Experts,
I'm trying to optimize some queries by making sure the indexes are pulling in the most efficient order. Can you take a look at this query and see if there is a better way to arr...
The primary key in a current table is set to VARCHAR(100). The columns start with S and then trail with several numbers. The new requirement is make all new records a number only and auto incr...
I have a table called "leagueTable". It contains the names of all the soccer teams in a league and the number of points that they have accumulated. When I execute the following SQL...
selec...
I want to identify records where Columns A, C, D, E, F, G, H, I are all equal. And where column B is not equal.
Then delete BOTH records.
Need query to do the following:
Have a table with the following information
Payment no. Invoice no. (character)
1 45
1 38
1 ...
Hi,
Below is 2 views, How to join all 4 tables in to one view?
Hello,
I want to add a slide bar to my site, which is dynamically set with yearly increments, so that i can filter the markers on my site which are held in MySQL with a DATE field.
I rea...
Using SQL 2000
I have two tables. The first table has a varchar column named phone. The second table has a numeric column called CPhone. In the first table the data contains phone number but ...