Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 05-19-2006, 05:47 AM SQL select statement
Skilled Talker

Posts: 95
Trades: 0
Hi guys i hope you can help.

I'm using this string in my asp page

SELECT SUM(Yr1FTE) as YR1FteTotal, sum(Yr2FTE) as YR2FteTotal, sum(Yr3FTE) as YR3FteTotal, sum(Yr4FTE) as YR4FteTotal, sum(Yr5FTE) as YR5FteTotal FROM tblStaffCostings Where costingId="&costingID

CostingId can change depending on what the user does.

The string works as it should it returns the totals if it finds any and nulls if it doesnt.

The nulls are my problem because this sql will return something i cant use the recordset.eof to see if it is blank. because a record of all nulls is still a recordset

I've tried using code such as

if (yr1ftetotal = "") then
yr1ftetotal = 1
end if

but it doesnt recognise that yr1total is ""

so my question is, Is there anyway in my string that i can convert the nulls to say a 0 or a 1 or if not what is the code for checking if a recordset isnull?

Last edited by higginbt; 05-19-2006 at 05:49 AM..
higginbt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-19-2006, 07:04 AM Re: SQL select statement
Skilled Talker

Posts: 95
Trades: 0
Ok people i've fixed the problem, again dont kow if its the best way of doing it

but i'm using

if isnull(yr1fte) then
yr1fte =1
end if




note* what is this sites problem with using the tab key *
higginbt is offline
Reply With Quote
View Public Profile
 
Old 05-19-2006, 09:25 AM Re: SQL select statement
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
what database server are you using?


no problem with the tab key as far as I can tell. It behaves as the tab key should in HTML pages, moves the focus on to the next active control.

what are you trying to do with it?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-22-2006, 01:17 PM Re: SQL select statement
Skilled Talker

Posts: 95
Trades: 0
off topic, but every time i press the tab key, to try and indent the text i'm typing in the messsage area it posts what i've written so far
higginbt is offline
Reply With Quote
View Public Profile
 
Old 05-22-2006, 01:32 PM Re: SQL select statement
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
yep that's what the tab key does on every HTML form in existence.

Here the textarea is immediately before the submit button in the form element order and if you press enter after the tab key it will submit the form 'cos the submit button has focus.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to SQL select statement
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21514 seconds with 12 queries