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

Posts: 95
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
 
When You Register, These Ads Go Away!
Old 05-19-2006, 07:04 AM Re: SQL select statement
Skilled Talker

Posts: 95
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
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,831
Location: Blackpool. UK
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!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
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
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
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,831
Location: Blackpool. UK
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!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to SQL select statement
 

Thread Tools

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

vB 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.12353 seconds with 12 queries