Hi,
My table (gift_history) looks like this:
donor_id number
gift_date datetime
gift_amount number
query looks like this:
select donor_id
from gift_history
where donor_id= 3890 And gift_date between '01/01/1991' and '01/01/1992'
group by donor_id having sum(gift_amount) between 15 and...
Hi,
I have a form that inserts data into an access db using an autonumber column. It passed QA, but in production I'm getting a lot of skipped autonumbers. is that normal? I have all input validated and errors trapped.
Hi,
I'm inserting about 500,000 records during which i'm converting a string to a date. I get an error:
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated.
How can I figure out which records...
Robert:
Yes, that works. But where I actually have this problem is in the following script:
--create cursor of existing records
Declare @origdate varchar(5), @id int
DECLARE cOrigdate CURSOR fast_forward for
SELECT origdate,id
FROM MEMBERS2 where len(origdate) = 4
ORDER BY id
begin
open...
Hi,
Any advice on the problem below? I have a 4 digit string representing a date which I can sucessfully convert when the year is prior to 2000. But, after 2000, I get a syntax error.
select convert(datetime,(substring(@date,1,2) + '01' + substring(@date,3,2)),101100)
1999-01-08...
hi,
i have a procedure which occasionally generates the following error:
Server: Msg 8152, Level 16, State 9, Line 112
String or binary data would be truncated.
The statement has been terminated.
is there any command I can issue prior to running the script so that such truncations would be...
I have a script which uses a cursor (cursor use is not the topic though :)). There are some records that, for various reasons, cause an errors such as:
1. can't insert null
2. data would have been truncated
3. eetc
which cause the statement to be aborted. My question is: what construct do...
Hi,
So I'm trying to embrace the "cursors are evil" mentality while doing some dataloads. My question is this:
Say I'm inserting 10 rows from a query into a table. The first 9 have no problems, but the last has an error because it has a null value, or an arithmetic overflow, or whatever...
i don't think i can use an "=" because it's part of a larger select statment, ie
SELECT
blah,
blah,
blah,
case addr2
when charindex(addr2,'@') > 0 then null
else addr2
end as addr2,
blah,
FROM members
What's wrong with my syntax? I can't see a differrence between...
Hi,
I have the following snippit:
select case addr2
when charindex(addr,'@') > 0 then null
else addr2
end as addr2 from members
when i run it i get:
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '>'.
what gives? addr2 is a...
Hello,
I have a ton of data that i need to import from one table to another database where the data will be split across multiple tables. additionally, the data needs to converted because whereas in the one table a column may be text, on the insert an id for that text value will be inserted...
the reason:
i have a search page with ~50 criteria. when someone searchs i'm taking the entire page and storing it in a cookie with delimited fieldname/value pairs.
when someone returns to search page, i can pull the cookie value and split it out into an array. then i can access the...
Hi,
I have an array with two cells. The first cell is the name of a variable and the 2nd cell has the value that i'd like to assign to that variable. How can I do this?
Thanks,
RP
i have a number of main-level and sub-level menu items which i need to display. depending on someone's role (stored in session) i need to modify which items are displayed.
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.