Help Sql Wizards

Jan 12, 2008

here is my dilemna...

I wish to retrieve values from the TICKERMASTER.TICKER table where

TICKERMASTER.TICKER IS NULL OR

TICKERMASTER.LASTDATE < DATE() OR

TICKERMASTER.LASTDATE = DATE() AND TICKERMASTER.EOD = FALSE

and in call cases output TICKERMASTER.TICKER, TICKERMASTER.LASTDATE AS LAST

except in the third OR command above, I would like the output changed to TICKERMASTER.TICKER, (TICKERMASTER.LASTDATE -1) as LAST

???? How the heck would I do that?  My SQL code is below your help is appreciated........

SELECT TickerMaster.Ticker, TickerMaster.LastDate AS [Last]
FROM TickerMaster
WHERE TickerMaster.LastDate Is Null OR
TickerMaster.LastDate <= Date() and TickerMaster.EOD =FALSE;
 

Table < TICKERMASTER >

Ticker FirstDate  LastDate  EOD
ABXA 1/12/2007 1/12/2008 No
AIRN                                 No
ALY                                   No
 

 

View 1 Replies


ADVERTISEMENT

For You SQL Wizards!

Nov 10, 2000

We are having a little question and answer contest over the month of November. Question #6 is
Question #6
Your company manages all of its data using Microsoft SQL Server and develops applications and components using Microsoft Visual Basic and Microsoft Office 97. At the end of each day, a client application calls a SQL Server computer to update records in two tables. The updates are based on the values of various fields in a third table. If any modification to either of the two modified tables does not complete, then you want the entire operation to fail so that no records are updated. How should you implement this?

a. Write a single stored procedure that will modify both of the tables. Use a single transaction inside the stored procedure and return an error to the client application if the transaction does not complete.
b. Write a single stored procedure that will modify both of the tables. Use two transactions inside the stored procedure, but only return information to the client application if the transaction completes successfully.
c. Write a separate stored procedure to modify each table. Use a single transaction to nest both stored procedure calls and return an error to the client application only if the transaction does not complete.
d. Write a separate stored procedure to modify each table. Use a separate transaction for each table and return a unique error code for the table that causes the first failure of the update transaction.


Does any one know the correct answer?

View 1 Replies View Related

Tricky Problem For SQL Wizards

Feb 23, 1999

This problem would appear to be simple, yet I cannot figure out how to do it.

I have a table called member that contains all of my mailing list members.
This query is supposed to show how many people signed up to the mailing list
on each day. The results of this query are sent to a graph generator
component.

Here's how I do it now

I run this query for each day that I want to see how many people signed up:

SELECT Count(dateupdated) AS Counter FROM member where convert(char(12),
dateupdated, 112) = convert(char(12), dateadd(day, -@days, getdate()), 112)

This works, but I have to run it for EACH day.... so I have to run 30 of
these queries if I want to find out how many people have signed up in the
last 30 days. I just increment the @days variable for each day I want to find.

My question is, how can you create a single query that will produce
a result like this:

day counter
------ ----------
2/1/99 1
2/2/99 15
2/3/99 12
2/4/99 3
2/5/99 5
2/6/99 1
2/7/99 0
2/8/99 0

Thanks people!

View 1 Replies View Related

SSIS And Import/export Wizards

Jan 11, 2007

Guys,

I am new to SQL Server 2005. I have installed Developer edition. I want to transfer data through DTS which is now SSIS - Sql Server Integration Service I believe.

One question though how do I access SSIS, I am doing normal imports and exports using the wizards. Is there any other interface to access the SSIS??

Please let me know

Thanks

View 3 Replies View Related

Unable To Use SQL Express Wizards To Export, Import

Jan 26, 2007

I am using SQL Server v8.0 Enterprise Manager and I have been trying to export a database and a table. But no matter how many times I try I keep getting error messages. It just wont let me make a backup of anything. Ideally I would like to make a backup of a table from within a database. Then restore it but use a different file name so I can have a sandbox with which to test something out. When using the Export wizard the destination server is local using Windows authentication.

Here is the error I typically see:

Error Source: Microsoft OLE DB Provider for SQL Server
Error Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Context: Error during initialization of the provider.


I only have one book which is Beginning SQL Server 2005 for Developers by Apress. It's great for most things but not this. Can anyone help me figure out how to do an export so I can create a sandbox environment with which to play and test with?

View 8 Replies View Related

Using SQL Server 2000 Export Wizards Programmatically By Using VB.NET 2003

Jul 8, 2006

Hello,

Is there possibility to use export wizard programmatically ?

I need to copy the database structure (New db based on existing with alll constraints and relationships) ?

Thnx

View 1 Replies View Related

Project Creation Error With Ivolva Component Wizards For Integration Services

Jun 5, 2006

Hi,

I'm just getting started with SSIS and want to create a custom data flow component. I found the Ivolva Digital "Component Wizards for Integration Services" which says it make starting your own custom task or data flow component
a snap by providing a functional base project for your task or component.

Therefore I installed the Component Wizards for Integration Services and everything seemed to install ok - when I started Visual Studio I had the "Custom Data Flow Component" and "Custom Task" templates available in the New Projects dialog.

However, when I try to create a project of either of these types I get the message "Creating project 'CustomTask1'...project creation error" in the status bar, and can't get past the New Project dialog. (I can create all other project types ok, though).

Can anyone offer any advice that might help me out here?

Thanks in advance,
Lawrie.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved