I have the following code
select id,date,class
from field1
having count(id) >1
My desired output is
ID date class
11 9/15/09 c
11 5/1/09 d
The only way an id should appear more than once is if it has multiple classes for the same id. Else I do not want it to appear...
Is there such a thing as multiple having clause in sql 2005
Here is my code
select count(id),batch, class, date
from Gifts
group by batch,class,date
having count(batch)>1
my desired output is
batch class
2322 m
2322 b
In other word I want the gift batch to show only if there is more...
I prepared the following as a stored procedure using a date parameter. I then pass it over to a crystal report. When I try and open the report in crystal 2008 it prompts me the the @GifteffdatBegin and @GifteffdatEnd date as it should. It prompts me to insert the date as follows mm/dd/yyyy...
I have the following code. THe first creates a table called Make_Batches. The second is an attempt to find duplicate batches if the batch number repeats itself. THe problem is since I chose the count of the giftid in the first table, it is not a true field so the dupicate code will not...
Here is a partial statement from a query I wrote in QA for SQL server 2005
gifteffdat >='2009-07-01 00:00:000'
Our database formats the date in a datetime format. For some reason SQL is ignoring my gifteffedat. Have I formatted this incorrectly?
I have the following code to be used in a stored procedure to ask for a datetime @Giftdate (ie 2009-06-07 00:00:00).
I am doing a union on the same table (gifttable) I am using an alias as you can see here. My question is
1. Can I declare the two @Giftdates as I have done here to tell them...
I have a one to many scenario and need assistance
One ID can have many Attributes
if ID has attribute 6025 I want to eliminate that ID in the VIEW or proceedure. Here is a sanpshot
ID Attribute
1233 6025
1233 6033
1233 6034
In this example because ID 1233 has 6025 I...
1. I have an ID for a constituent
2. The consituent can have multiple characteristics
3. In the select expert I choose
not characteristic = 1
What happens is the constituent record with characteristic 1 will not show up. However because that contituent has other characteristics he will show...
and giftlook1 ^= 'ng' or giftlook1 = ' '
or giftlook1 is null
this is part of a statement that is designed to eliminate a giftlook1 coded as 'ng'. Sometimes the giftlook field is blank or null. When I plug in
and giftlook1 ^= 'ng' or giftlook1 = ' '
I get close to what I want. When I...
I have an access table with 15 totals based on a year (ie 94-95, 95-96 and so on). I need to flag those records in which a person gave at least 100.00 for 5 consecutive years within that 15 year period. I have 4000 records to check. Is there a way to do this in access programatically without...
ALTER PROCEDURE [dbo].[usp_px1]
-- Add the parameters for the stored procedure here
@birthmth char(2)
AS
select coreid,birthmth,attrtype
from core inner join attribute
on attrid = coreid
where attrtype = 'px1'
and brthmn = @brthmn
When executed, this passes a single parameter for a birth...
Crystal allows you to save a .txt file of the report definition. is there also a way to save the schema ( or information on tables and links used)? We need this information as a reference in the event we need to reuse a crystal format
Platform: MS SQL Server 2005
I am trying to construct an sql view based on a fiscal year starting with 7(July) and ending with 6(June). I will eventually use totals for a 4 year fiscal year. If the giftdate falls within the date range, I want to list the totals in the correct fiscal year. I...
OS: Windows XP
IE Version: IE 7
Server attempting to connect to: MySQL Unix Apache Server
Problem
1. When I click add a network place from My Network Connections, nothing happens.
2. When I visit a website and choose File/Edit with Microsoft Front Page I get the page but no prompting for my user...
SELECT addrid, addrphone, addrline1, addrcity, addrplace, addrzipcod, addrdate
FROM dbo.address_full
WHERE
(addrphone NOT LIKE '[0-9][0-9][0-9].[0-9][0-9][0-9].[0-9][0-9][0-9][0-9]')
AND (addrforign = 'N')
and addrphone is not null
Platform used: SQL 2005...
I used record insertion wizard from a table employee. I created three recordsets rs_employee, rs_Supervisor and rs_Title. There are three tables, Employee, Supervisor and Title. I link the three tables by name, not by a primary key. What happens is when I test the form and click the insert...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.