Hi All,
I'm trying to find a way to declare a class in a code behind page that will allow me to use it within different functions and procedures without having to declare it each time.
Another question while I'm asking, when I declare the class, I pass it a userID which is stored as a session...
It got it to work :)
My solution is
DECLARE @start smalldatetime
DECLARE @end smalldatetime
SELECT @start ='20040101'
SELECT @end = '20040201'
WHILE @start <= @end
BEGIN
IF DATEPART(dw,@start) = 1
BEGIN
INSERT INTO tbl_Rota
(ShiftID,
[Date])
SELECT...
Simon,
Please forgive my ignorance, could you please explain how this will work?
WHILE DATEPART(dw,@j)<>2 - Why not equal to 2?
I am thinking of something like this
WHILE @j <= @LastDate
IF DATEPART(dw,@j) = 1
BEGIN
INSERT INTO Rota
(ShiftID,
[Date])
SELECT...
Thanks for your replies guys,
A bit more information as you requested.
Default Table:
ID ShiftID Day
1 1 1
2 3 1
3 5 2
4 1 2
Rota Table
RotaID ShiftID Date
1 1 1/1/2000
I want to take all the default values...
Hi All,
I am about to write a Stored Procedure and thought i would ask if anyone had any advice.
The query is to take values from a default table, and add them to another "live" table.
Every monday an "A" shift is to take place. - From the default table
I want to take the that shift and make...
Hi All,
I was wondering if anyone knows how, it at all, a guid can be removed from a table. Just the existing value, not the row.
I have a table with a guid column that relates to another table and its value is a guid. I want to set the guid to nothing if it is deleted from the other table...
Hi All,
I am trying to find a way to use a stored procedure to filter out the records i do not want rather than in my program.
I have a list of shifts that are linked to a piece of equiptment, which has an equiptmentID.
I have a table that links workerID's to what equiptment they can work...
Hi All,
I am have been looking into why a script of mine does not work, when I came across i very strange error. My server does not like the day 29th March 2004. Then when i dig a little deeper, it turns out it does not like the last Sunday of March in any year.
Although I am able to format...
Fixed that problem! there where no brackets in the While statement :|
BUT... but he says... it is only pulling out 1 entry, then there should be 2. i can see them in the database, and extract them out using SQL on the database itself, but the page is only displaying 1 row. I can change wht is...
Thank you guys,
Can i ask you just one more question, howdo you connect to your database?
I use the following code:
connect($dbhost, $dbuser, $dbpass, $dbname);
$query_ProductDetails = "SELECT * FROM tbl_product";
$ProductDetails = mysql_query($query_ProductDetails)...
Hi sleipnir,
the two functions read the integer values from the database and replay with a text string depending on the value. these are always in the database as they are required fields. i have just check and these values are not being retunrd from the database either :|
This is the code i...
Hi All,
I'm very new to PHP, I'm an ASP guy traditionally.
I have come across a very strange problem when extracting data from a MySQL DB.
It seems to "skip" bits of data. I have used the following code:
echo "Serial Number: $row[SerialNo]
echo "Repair Type: "...
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.