显示标签为“newsgroup”的博文。显示所有博文
显示标签为“newsgroup”的博文。显示所有博文

2012年3月25日星期日

Anyone have an answer to this?

Anyone have an answer to this?
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Anyone have an answer to what?
(Hint: if you use a threaded newsreader, instead of a web-based interface,
and keep the subject the same as it was before, you'll have better luck
tracking threads and following up.)
http://www.aspfaq.com/
(Reverse address to reply.)
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:OWNxJhmSEHA.2408@.tk2msftngp13.phx.gbl...
> Anyone have an answer to this?
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.
sql

Anyone have an answer to this?

Anyone have an answer to this?
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine sup
ports Post Alerts, Ratings, and Searching.Anyone have an answer to what?
(Hint: if you use a threaded newsreader, instead of a web-based interface,
and keep the subject the same as it was before, you'll have better luck
tracking threads and following up.)
http://www.aspfaq.com/
(Reverse address to reply.)
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:OWNxJhmSEHA.2408@.tk2msftngp13.phx.gbl...
> Anyone have an answer to this?
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.

Anyone have an answer to this?

Anyone have an answer to this?
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.Anyone have an answer to what?
(Hint: if you use a threaded newsreader, instead of a web-based interface,
and keep the subject the same as it was before, you'll have better luck
tracking threads and following up.)
--
http://www.aspfaq.com/
(Reverse address to reply.)
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:OWNxJhmSEHA.2408@.tk2msftngp13.phx.gbl...
> Anyone have an answer to this?
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.

2012年3月11日星期日

Any true public variables for custom code section?

I have been searching the newsgroup for showing the group sum in the
footer section. This isn't the same as a normal group sum as the
amount shown in the textbox is using the value straight out of the
dataset - =Fields!Amt.Value, instead of =SUM(Fields!Amt.Value). I then
wanted to show the sum of the group amounts in the footer.
I thought I had found a solution by calling a function to store the
sum and then show the total by calling the same function with a
parameter to return the accumulated amount. Unfortunately I hit
another brick wall with this approach because even though I declared a
public variable outside the function (also tried a static within the
function), the accumulated amount only remains within the scope of
the group calling the function. When the footer section calls the same
function the accumulator is 0 instead of the accumulated amount for
the group.
My question, how do you declare and access a true public variable?
Here's an example of what is happening:
The group amount only needs to be displayed within the group, but
summed at the end of the report
Report
--
Group1 (grouped by MbGUID)
Textbox = AddGroupTotal("A", Fields!SizeTtl.Value)
Footer
Textbox = AddGroupTotal("T", 0) ' Note the "0" is just a
placeholder
Dataset columns
--
MbGUID,SizeTtl,Year,Month,Week,MaxSize
Data
--
1,120,2006,1,2,80
1,120,2006,1,3,90
1,120,2006,1,4,92
2,130,2006,1,3,87
2,130,2005,1,4,120
The output with the custom code
--
MbGuid Total
1 120
2 130
Report Total: 0
Obviously the Report Total should show 250 instead of 0.
Custom Code Section
--
Public ttl As Double = 0
Public Function AddGroupTotal(pMode As String, pNbr As Long) As Long
'Static Ttl AS Long
If pMode = "A" Then
If Ttl = Nothing Then
Ttl = 0
End If
Ttl = Ttl + pNbr
' Runtime error stating parameter is read only for the below
statement
'Report.Parameters!pSizeTtl = pNbr
AddGroupTotal = pNbr
ElseIf pMode = "T" Then
AddGroupTotal = Ttl
End If
End Function
MarkI'm also having the same problem.
I'm attempting to build a public array in the details section of a table and
then perform calculations against that, now filled array in the group footer.
The problem is that when I call my custom AddToArray code in the details
section and then return the ubound value of the array, it works fine in the
details section but when it gets to the footer the array is empty again.
Anyone have any suggestions?
"Mark" wrote:
> I have been searching the newsgroup for showing the group sum in the
> footer section. This isn't the same as a normal group sum as the
> amount shown in the textbox is using the value straight out of the
> dataset - =Fields!Amt.Value, instead of =SUM(Fields!Amt.Value). I then
> wanted to show the sum of the group amounts in the footer.
> I thought I had found a solution by calling a function to store the
> sum and then show the total by calling the same function with a
> parameter to return the accumulated amount. Unfortunately I hit
> another brick wall with this approach because even though I declared a
> public variable outside the function (also tried a static within the
> function), the accumulated amount only remains within the scope of
> the group calling the function. When the footer section calls the same
> function the accumulator is 0 instead of the accumulated amount for
> the group.
> My question, how do you declare and access a true public variable?
> Here's an example of what is happening:
> The group amount only needs to be displayed within the group, but
> summed at the end of the report
> Report
> --
> Group1 (grouped by MbGUID)
> Textbox = AddGroupTotal("A", Fields!SizeTtl.Value)
> Footer
> Textbox = AddGroupTotal("T", 0) ' Note the "0" is just a
> placeholder
> Dataset columns
> --
> MbGUID,SizeTtl,Year,Month,Week,MaxSize
> Data
> --
> 1,120,2006,1,2,80
> 1,120,2006,1,3,90
> 1,120,2006,1,4,92
> 2,130,2006,1,3,87
> 2,130,2005,1,4,120
> The output with the custom code
> --
> MbGuid Total
> 1 120
> 2 130
> Report Total: 0
> Obviously the Report Total should show 250 instead of 0.
>
> Custom Code Section
> --
> Public ttl As Double = 0
> Public Function AddGroupTotal(pMode As String, pNbr As Long) As Long
> 'Static Ttl AS Long
> If pMode = "A" Then
> If Ttl = Nothing Then
> Ttl = 0
> End If
> Ttl = Ttl + pNbr
> ' Runtime error stating parameter is read only for the below
> statement
> 'Report.Parameters!pSizeTtl = pNbr
> AddGroupTotal = pNbr
> ElseIf pMode = "T" Then
> AddGroupTotal = Ttl
> End If
> End Function
> Mark
>

2012年3月8日星期四

any SQL gurus out there?

Hello, this probably isnt the best place to ask but I can't find a more
suitable sql newsgroup so I hope y'all dont mind too much.

I have 2 tables; Cellar and Colour

CELLAR contains the wine name, its year and the no.of bottles.

Wine Year Bottles
Chardonnay 87 4
Fume Blanc 87 2
Pinot Noir 82 3
Zinfandel 84 9

COLOUR contains wine name and it's colour

Wine Colour
Chardonnay White
Fume Blanc White
Pinot NoirRed
Zinfandel Rose

This is from a past exam paper btw

One of the questions was:
Write the sql to count how many white wines there are in the table cellar.

The solution that the lecturers included is:

SELECT count(wine)

FROM cellar

WHERE colour='White'

Now i havent' been able to try out this sql yet but to me that looks wrong.

My solution would be:

SELECT count(wine)

FROM cellar

WHERE cellar.wine = colour.wine and colour.colour='White'

Can anyone tell me which one is correct, and if mine isn't correct then why
isn't it?

Thanks>> Write the sql to count how many white wines there are in the table
cellar. <<

The first answer is wrong; look at the missing table in the FROM
clause. And the quesiton is vague. Do I want the actual bottle count
or a count by wine_type

SELECT COUNT(DISTINCT type_wine) AS type_count, COUNT(*) AS
bottle_count
FROM Cellar AS C, WineColours AS W
WHERE C.wine_type = W.wine_type
AND W.colour = 'White' ;

I have a total of six bottles of whites in two varieties.|||> The first answer is wrong; look at the missing table in the FROM
> clause. And the quesiton is vague. Do I want the actual bottle count
> or a count by wine_type
> SELECT COUNT(DISTINCT type_wine) AS type_count, COUNT(*) AS
> bottle_count
> FROM Cellar AS C, WineColours AS W
> WHERE C.wine_type = W.wine_type
> AND W.colour = 'White' ;
> I have a total of six bottles of whites in two varieties.

thanks for your answer

yeh the question is poorly worded however I believe it simply refers to the
number of types, i.e 2 (chardonnay, fume blanc).|||Well, you don't need an "SQL guru" for that query. Since the question is
not really clear, you can pick the column you need.

SELECT COUNT(Distinct Wine) NumberOfWhiteWineBrands
, SUM(Bottles) NumberOfBottlesOfWhiteWine
FROM Cellar
INNER JOIN Colour
ON Colour.Wine = Cellar.Wine
WHERE Colour.Colour = 'White'

If it is the column "NumberOfWhiteWineBrands" that you need, then you
could also write

SELECT COUNT(*)
FROM Colour
WHERE Colour = 'White'
AND EXISTS (
SELECT 1
FROM Cellar
WHERE Cellar.Wine = Colour.Wine
)

HTH,
Gert-Jan

Jay wrote:
> Hello, this probably isnt the best place to ask but I can't find a more
> suitable sql newsgroup so I hope y'all dont mind too much.
> I have 2 tables; Cellar and Colour
> CELLAR contains the wine name, its year and the no.of bottles.
> Wine Year Bottles
> Chardonnay 87 4
> Fume Blanc 87 2
> Pinot Noir 82 3
> Zinfandel 84 9
> COLOUR contains wine name and it's colour
> Wine Colour
> Chardonnay White
> Fume Blanc White
> Pinot NoirRed
> Zinfandel Rose
> This is from a past exam paper btw
> One of the questions was:
> Write the sql to count how many white wines there are in the table cellar.
> The solution that the lecturers included is:
> SELECT count(wine)
> FROM cellar
> WHERE colour='White'
> Now i havent' been able to try out this sql yet but to me that looks wrong.
> My solution would be:
> SELECT count(wine)
> FROM cellar
> WHERE cellar.wine = colour.wine and colour.colour='White'
> Can anyone tell me which one is correct, and if mine isn't correct then why
> isn't it?
> Thanks

Any response?

Am I in the wrong newsgroup? I thought I read that there should be some
response from Microsoft within one working day?
The question below was posted over a week ago....
Hi
I have SQL2000 dev edition installed and am trying to install a new named
instance of MSDE2000A (to replicate what users will be doing).
However when I run Setup I get "The system administrator has set policies to
prevent this installation." But I am the system administrator!
Setup ini files is as follows:
[Options]
INSTANCENAME="System5"
TARGETDIR="C:\Program Files\Silvertree Engineering\IceSpy System5\"
DATADIR="C:\Program Files\Silvertree Engineering\IceSpy System5\Data\"
DISABLENETWORKPROTOCOLS=0
SECURITYMODE=SQL
and I am adding an SAPWD to the command line.
I have the same problem with trying to re-install MS-Office 2003 on a
client's PC. I also logged-in as the admin. I tried editing the registry by
deleting all MS-Office-related entries; somehow, the system still detects
that a previous version had been installed (the program folders were deleted,
including those in "docs & settings).
If you get e decent answer to this problem, please forward to me.
Thanx!
"quilkin" wrote:

> Am I in the wrong newsgroup? I thought I read that there should be some
> response from Microsoft within one working day?
> The question below was posted over a week ago....
> Hi
> I have SQL2000 dev edition installed and am trying to install a new named
> instance of MSDE2000A (to replicate what users will be doing).
> However when I run Setup I get "The system administrator has set policies to
> prevent this installation." But I am the system administrator!
> Setup ini files is as follows:
> [Options]
> INSTANCENAME="System5"
> TARGETDIR="C:\Program Files\Silvertree Engineering\IceSpy System5\"
> DATADIR="C:\Program Files\Silvertree Engineering\IceSpy System5\Data\"
> DISABLENETWORKPROTOCOLS=0
> SECURITYMODE=SQL
> and I am adding an SAPWD to the command line.
>
|||Microsoft may monitor these newsgroups but there is no guarantee that
someone from MS will respond.
Have you checked to see if there has been any changes the security settings
of your system?
Jim
"quilkin" <quilkin@.discussions.microsoft.com> wrote in message
news:BCEA697C-6EFB-4C68-89C0-D86D2B240254@.microsoft.com...
> Am I in the wrong newsgroup? I thought I read that there should be some
> response from Microsoft within one working day?
> The question below was posted over a week ago....
> Hi
> I have SQL2000 dev edition installed and am trying to install a new named
> instance of MSDE2000A (to replicate what users will be doing).
> However when I run Setup I get "The system administrator has set policies
> to
> prevent this installation." But I am the system administrator!
> Setup ini files is as follows:
> [Options]
> INSTANCENAME="System5"
> TARGETDIR="C:\Program Files\Silvertree Engineering\IceSpy System5\"
> DATADIR="C:\Program Files\Silvertree Engineering\IceSpy System5\Data\"
> DISABLENETWORKPROTOCOLS=0
> SECURITYMODE=SQL
> and I am adding an SAPWD to the command line.
>