Showing posts with label based. Show all posts
Showing posts with label based. Show all posts

Friday, March 30, 2012

NEWBIE question for ya!

I ve been ask to diplay some infomation based a certain date and time.
I'll be using asp and mssql 2k.
Like friday between 8:00pm to 10pm to display
then on Saturday between 2:00pm and 4:00pm to display and for the rest of
the time not display. any suggetions.
I've been looking at getday()
any suggetions?
Thank you for your time in advanced.
Message posted via http://www.sqlmonster.com
Sven,
Check this article:
http://www.karaszi.com/sqlserver/inf...asp#Searching.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Sven Garber via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:a2eae88fcfcc4a3494bcb278914a66d9@.SQLMonster.c om...
> I ve been ask to diplay some infomation based a certain date and time.
> I'll be using asp and mssql 2k.
> Like friday between 8:00pm to 10pm to display
> then on Saturday between 2:00pm and 4:00pm to display and for the rest of
> the time not display. any suggetions.
> I've been looking at getday()
> any suggetions?
> Thank you for your time in advanced.
> --
> Message posted via http://www.sqlmonster.com
|||Dejan,
Thank you for the link referal...
Sharing is caring...
Thank you
Message posted via http://www.sqlmonster.com

NEWBIE question for ya!

I ve been ask to diplay some infomation based a certain date and time.
I'll be using asp and mssql 2k.
Like friday between 8:00pm to 10pm to display
then on Saturday between 2:00pm and 4:00pm to display and for the rest of
the time not display. any suggetions.
I've been looking at getday()
any suggetions?
Thank you for your time in advanced.
Message posted via http://www.droptable.comSven,
Check this article:
http://www.karaszi.com/sqlserver/in...asp#Searching.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Sven Garber via droptable.com" <forum@.droptable.com> wrote in message
news:a2eae88fcfcc4a3494bcb278914a66d9@.SQ
droptable.com...
> I ve been ask to diplay some infomation based a certain date and time.
> I'll be using asp and mssql 2k.
> Like friday between 8:00pm to 10pm to display
> then on Saturday between 2:00pm and 4:00pm to display and for the rest of
> the time not display. any suggetions.
> I've been looking at getday()
> any suggetions?
> Thank you for your time in advanced.
> --
> Message posted via http://www.droptable.com|||Dejan,
Thank you for the link referal...
Sharing is caring...
Thank you
Message posted via http://www.droptable.com

NEWBIE question for ya!

I ve been ask to diplay some infomation based a certain date and time.
I'll be using asp and mssql 2k.
Like friday between 8:00pm to 10pm to display
then on Saturday between 2:00pm and 4:00pm to display and for the rest of
the time not display. any suggetions.
I've been looking at getday()
any suggetions?
Thank you for your time in advanced.
--
Message posted via http://www.sqlmonster.comSven,
Check this article:
http://www.karaszi.com/sqlserver/info_datetime.asp#Searching.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Sven Garber via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:a2eae88fcfcc4a3494bcb278914a66d9@.SQLMonster.com...
> I ve been ask to diplay some infomation based a certain date and time.
> I'll be using asp and mssql 2k.
> Like friday between 8:00pm to 10pm to display
> then on Saturday between 2:00pm and 4:00pm to display and for the rest of
> the time not display. any suggetions.
> I've been looking at getday()
> any suggetions?
> Thank you for your time in advanced.
> --
> Message posted via http://www.sqlmonster.com|||Dejan,
Thank you for the link referal...
Sharing is caring...
Thank you
--
Message posted via http://www.sqlmonster.com

Monday, March 26, 2012

Newbie Question

I want to load a dropdown list based on another dropdown selection.Iam not sure how to do this.

Both are report parameters.Based on one parameter i need to load another parameter.

Can someone help me.

Thanks in advance

mahalaks.

hello,

I believe in the properties for the drop down, you can define a constraint (drop down), which is where you set that up.

Brian

|||

Both dropdown boxes are report parameters.

Based on the report parameters dropdown boxes are coming.

No properties can be set for this.

Friday, March 9, 2012

Newbie Database Diagraming Error Problem

I am in the process of taking my first stab at a MS SQL Server based DB.
The original DB was in MS Access and had a front end DB with the GUI and a
back end with the data. The data has been successfully transferred to the
SQL Server. Now I am in the process of re-building the relationships and am
getting a number of errors of the form:
'tblRoadTrip (MyDomain\TheUser)' table
- Unable to create relationship 'FK_tblRoadTrip_tblPrimary'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE
statement conflicted with COLUMN FOREIGN KEY constraint
'FK_tblRoadTrip_tblPrimary'. The conflict occurred in database
'MyFirstSQL_DB', table 'tblPrimary', column 'LinkID'.
when using the diagramming tool. The relationship between tblPrimary and
tblRoadTrip is one-to-many and the linking filed is LinkID. In tblPrimary,
LinkID is set as the primary key.
Any hints on where I can go to get information on how to solve this problem
will be greatly appreciated!
Thanks!
Don
Okay, I think I found the problem, we sort of ......
The table tblPrimary is empty! I went back to the Upsizing Wizard Report,
and low and behold the following message "Table was skipped, or export
failed". Will very authoritative, lacking in any information to diagnose
why the table was skipped or the export failed. I tried re-exporting the
table all by itself, and the report for that says "skipping table
'tblPrimary'".
What causes a file to be skipped during the upsizing wizard process?
Don
"Don" <someone@.somewhere.net> wrote in message
news:e40TnYRwFHA.2656@.TK2MSFTNGP09.phx.gbl...
> I am in the process of taking my first stab at a MS SQL Server based DB.
> The original DB was in MS Access and had a front end DB with the GUI and a
> back end with the data. The data has been successfully transferred to the
> SQL Server. Now I am in the process of re-building the relationships and
> am getting a number of errors of the form:
> 'tblRoadTrip (MyDomain\TheUser)' table
> - Unable to create relationship 'FK_tblRoadTrip_tblPrimary'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE
> statement conflicted with COLUMN FOREIGN KEY constraint
> 'FK_tblRoadTrip_tblPrimary'. The conflict occurred in database
> 'MyFirstSQL_DB', table 'tblPrimary', column 'LinkID'.
> when using the diagramming tool. The relationship between tblPrimary and
> tblRoadTrip is one-to-many and the linking filed is LinkID. In
> tblPrimary, LinkID is set as the primary key.
> Any hints on where I can go to get information on how to solve this
> problem will be greatly appreciated!
> Thanks!
> Don
>
>
|||Figuring that bad data might be a cause, I finally found the problem with
some invalid dates. While the MS Access table used date fields, looks like
it is much more forgiving in terms of mis-entered dates.
Don
"Don" <someone@.somewhere.net> wrote in message
news:OYLs7FSwFHA.3300@.TK2MSFTNGP09.phx.gbl...
> Okay, I think I found the problem, we sort of ......
> The table tblPrimary is empty! I went back to the Upsizing Wizard Report,
> and low and behold the following message "Table was skipped, or export
> failed". Will very authoritative, lacking in any information to diagnose
> why the table was skipped or the export failed. I tried re-exporting the
> table all by itself, and the report for that says "skipping table
> 'tblPrimary'".
> What causes a file to be skipped during the upsizing wizard process?
> Don
>
>
> "Don" <someone@.somewhere.net> wrote in message
> news:e40TnYRwFHA.2656@.TK2MSFTNGP09.phx.gbl...
>

Newbie Database Diagraming Error Problem

I am in the process of taking my first stab at a MS SQL Server based DB.
The original DB was in MS Access and had a front end DB with the GUI and a
back end with the data. The data has been successfully transferred to the
SQL Server. Now I am in the process of re-building the relationships and am
getting a number of errors of the form:
'tblRoadTrip (MyDomain\TheUser)' table
- Unable to create relationship 'FK_tblRoadTrip_tblPrimary'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER
TABLE
statement conflicted with COLUMN FOREIGN KEY constraint
'FK_tblRoadTrip_tblPrimary'. The conflict occurred in database
'MyFirstSQL_DB', table 'tblPrimary', column 'LinkID'.
when using the diagramming tool. The relationship between tblPrimary and
tblRoadTrip is one-to-many and the linking filed is LinkID. In tblPrimary,
LinkID is set as the primary key.
Any hints on where I can go to get information on how to solve this problem
will be greatly appreciated!
Thanks!
DonOkay, I think I found the problem, we sort of ......
The table tblPrimary is empty! I went back to the Upsizing Wizard Report,
and low and behold the following message "Table was skipped, or export
failed". Will very authoritative, lacking in any information to diagnose
why the table was skipped or the export failed. I tried re-exporting the
table all by itself, and the report for that says "skipping table
'tblPrimary'".
What causes a file to be skipped during the upsizing wizard process?
Don
"Don" <someone@.somewhere.net> wrote in message
news:e40TnYRwFHA.2656@.TK2MSFTNGP09.phx.gbl...
> I am in the process of taking my first stab at a MS SQL Server based DB.
> The original DB was in MS Access and had a front end DB with the GUI and a
> back end with the data. The data has been successfully transferred to the
> SQL Server. Now I am in the process of re-building the relationships and
> am getting a number of errors of the form:
> 'tblRoadTrip (MyDomain\TheUser)' table
> - Unable to create relationship 'FK_tblRoadTrip_tblPrimary'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALT
ER TABLE
> statement conflicted with COLUMN FOREIGN KEY constraint
> 'FK_tblRoadTrip_tblPrimary'. The conflict occurred in database
> 'MyFirstSQL_DB', table 'tblPrimary', column 'LinkID'.
> when using the diagramming tool. The relationship between tblPrimary and
> tblRoadTrip is one-to-many and the linking filed is LinkID. In
> tblPrimary, LinkID is set as the primary key.
> Any hints on where I can go to get information on how to solve this
> problem will be greatly appreciated!
> Thanks!
> Don
>
>|||Figuring that bad data might be a cause, I finally found the problem with
some invalid dates. While the MS Access table used date fields, looks like
it is much more forgiving in terms of mis-entered dates.
Don
"Don" <someone@.somewhere.net> wrote in message
news:OYLs7FSwFHA.3300@.TK2MSFTNGP09.phx.gbl...
> Okay, I think I found the problem, we sort of ......
> The table tblPrimary is empty! I went back to the Upsizing Wizard Report,
> and low and behold the following message "Table was skipped, or export
> failed". Will very authoritative, lacking in any information to diagnose
> why the table was skipped or the export failed. I tried re-exporting the
> table all by itself, and the report for that says "skipping table
> 'tblPrimary'".
> What causes a file to be skipped during the upsizing wizard process?
> Don
>
>
> "Don" <someone@.somewhere.net> wrote in message
> news:e40TnYRwFHA.2656@.TK2MSFTNGP09.phx.gbl...
>

Newbie CURSOR question, insert values into a table?

How can I insert values into a table based on the fetch I do. The examples
I have been able to find all shows how to use "print" to show how Cursors
work.

I want to read through a table, and only insert values into another table if
some conditions on the row is true.

Can this be done, if so how?

Thanks in advance.

Henrik.You can do this, but in general you should avoid cursors unless there
is no other choice. It may be that your cursor can be written as a
single insert statement, in which case it will be a lot faster and
easier to code. See below for a rough example.

Simon

/* With a cursor */

declare @.var1 int, @.var2 int

declare cur cursor fast_forward for
select col1, col2
from dbo.table1

open cur

fetch cur into @.var1, @.var2

while @.@.fetch_status = 0
begin
if @.var1 > @.var2 -- check conditions
begin
insert into dbo.table2 (col1, col2)
select @.var1, @.var2
end

fetch cur into @.var1, @.var2
end

close cur
deallocate cur

/* With an insert */

insert into dbo.table2 (col1, col2)
select col1, col2
from dbo.table1
where col1 > col2

"Henrik Hjllund Hansen" <hh@.dlf.dk> wrote in message news:<be367e$2fng$1@.news.cybercity.dk>...
> How can I insert values into a table based on the fetch I do. The examples
> I have been able to find all shows how to use "print" to show how Cursors
> work.
> I want to read through a table, and only insert values into another table if
> some conditions on the row is true.
> Can this be done, if so how?
> Thanks in advance.
> Henrik.|||Hi,

Refer solution below:

Entity/Objects:
(Assume all fields in this example are varchar).

Table1 (Field1,Field2)
Table2 (Field1,Field2, Field3)

Script:
Declare @.F1 Varchar, @.F2 Varchar

--Get records
Declare RS cursor for Select Field1, Field2 from Table1 Where Field1=
A%'
Open RS --Open cursor

Fetch Next From RS into @.F1, @.F2
While @.@.Fetch_Status=0 --Check cursor if end of file
Begin
--Your insert in second table if condition matches.
If RTrim(@.F1) = ABC' And RTrim(@.F2) = Google'
Begin
--Post script to insert in Table2
Insert Into Table2

End

Fetch Next From RS into @.F1, @.F2
End

Close RS --Close cursor
Deallocate RS --relaese memory.

For additional information on updating selected columns in cursor and
complete syntax refer SQL Server Books Online sections.
a)DECLARE CURSOR
b)@.@.Fetch_Status

Hope this helps you.
Thanks Amit

"Henrik Hjllund Hansen" <hh@.dlf.dk> wrote in message news:<be367e$2fng$1@.news.cybercity.dk>...
> How can I insert values into a table based on the fetch I do. The examples
> I have been able to find all shows how to use "print" to show how Cursors
> work.
> I want to read through a table, and only insert values into another table if
> some conditions on the row is true.
> Can this be done, if so how?
> Thanks in advance.
> Henrik.|||Thanks a lot for your answers.

Henrik

"Henrik Hjllund Hansen" <hh@.dlf.dk> wrote in message
news:be367e$2fng$1@.news.cybercity.dk...
> How can I insert values into a table based on the fetch I do. The
examples
> I have been able to find all shows how to use "print" to show how Cursors
> work.
> I want to read through a table, and only insert values into another table
if
> some conditions on the row is true.
> Can this be done, if so how?
> Thanks in advance.
> Henrik.