Showing posts with label container. Show all posts
Showing posts with label container. Show all posts

Thursday, March 8, 2012

AssignExpression In For Loop Container

What I'm trying to do is take multiple "snapshots" of a membership for many months. I was trying to do this in a For Loop Container in which I added one to the month variable and subtracted one from an iteration variable each loop, unless the month variable = 13...then I would add one to the year variable, set the month variable to 1 and subtract one from the iteration variable. This, I was hoping, would allow me to initialize 24 to the iteration variable, 1 to the month variable and 2004 to the year variable, kick off the package, and get 2 years worth of "snapshots" in seperate files (one for each month). Here is the AssignExpression I thought would work:

@.Member_Month == 13 ? @.Member_Month = 1 && @.Member_Year= @.Member_Year + 1 && @.Member_Iteration = @.Member_Iteration - 1 : @.Member_Month = @.Member_Month + 1 && @.Member_Iteration = @.Member_Iteration - 1

The package states that the single "=" should be double, but I don't think that that is what I want to do (I tried doing this just to check, and it didn't like this either). I think that it is having problems with doing multiple things on both sides of the ":". What am I doing wrong?

Thanks,

Brian Layden

The AssignExpression supports only a single assignment. Can you put the logic of updating Month and Year inside the loop in a script, perhaps?

Thursday, February 9, 2012

Asp.net / sql help

ok first satrt with asp .net as this is simple or should be

< %# DataBinder.Eval(Container.DataItem, "Price", "{0:c}") %>
the {0:c} defines it to 2 decimal palces and i assume as a currency

now i have a short date one but it displays the time as well obviousley time is just 00:00:00 but was is the mask for it?

< %# DataBinder.Eval(Container.DataItem, "Date", "?mask??") %
ok now for sql i have 3 tables as follow
[code]

[SIZE=3]Education[/SIZE]
edId - primary key
edSchool
edDateBegin
edDateEnd

[SIZE=3]EducationLevel[/SIZE]
edId – foreign key link
lvlId – primary key
Level

[SIZE=3]EducationMarks[/SIZE]
lvlId – foreign key link
lvlname
Description
[/code]

And at the minute have got it working like this
[code]
ALTER PROCEDURE GetMarks

AS

SELECT edSchool, edDatebegin, edDateEnd,
EducationLevel.level
FROM Education INNER JOIN EducationLevel
ON Education.edID = EducationLevel.edID

RETURN
[/code]

How do i include the third table in it?
i tried this but syntax errors on the 2nd on statment

[code]

ALTER PROCEDURE GetMarks

AS

SELECT edSchool, edDatebegin, edDateEnd,
EducationLevel.level, EducationMark.lvlName, EducationMark.Description
FROM Education INNER JOIN EducationLevel INNER JOIN EducationMark
ON Education.edID = EducationLevel.edID and EducationLevel.lvlid = EducationMark.lvlId

RETURN

[/code]

Any help Much apreciated.Try

ALTER PROCEDURE GetMarks

AS

SELECT edSchool, edDatebegin, edDateEnd,
EducationLevel.level, EducationMark.lvlName, EducationMark.Description
FROM Education INNER JOIN EducationLevel ON Education.edID = EducationLevel.edID INNER JOIN EducationMark on EducationLevel.lvlid = EducationMark.lvlId

RETURN

|||thx got that working i just cant figure out how to get it. i need a list in a list how the hell do you do this i cant get my head round it.

i have 3 tables as above the middle one just being a joining table so you dont have many to many relationships. now i want to display it as below

Title1
content 1
content 2
content 3

Title 2
blah 1
blah 2
blah 3

Title 4
ex 1
ex 2
ex 3

Ect ect

But im using a datalist template item but that only does 1 list not a list inside a list so i get the following

Title1 - content 1
Title1 - content 2
Title1 - content 3
Title1 - content 4

Title 2 - blah 1
Title 2 - blah 2
Title 2 - blah 3

Ect ect can any1 help or give me a link which expalins how to do this thanx