Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Bobalooey

    Date format question???

    I can see that your dates are dd/mm/yy format, that changes some things. To simulate your problem, try the following query, it should throw the same error you've been experiencing. declare @sourcedate varchar(17) select @sourcedate = '21/01/03 12:03:32' select convert(datetime,@sourcedate) as...
  2. Bobalooey

    Page Frame page order

    This couldn't be easier. right click on the pageframe and choose EDIT. You should now see a light blue marquee around the whole pageframe to indicate that you are in Page edit mode. While in the Page edit mode, left click on the page you want to move (eg. Page 2), now right click the page and...
  3. Bobalooey

    Self-referencing Hierarchy?

    You may still be able to perform what you need in a query if you don't need to do fetch looping. Can you pull some actual data from your table, show some rows in a reply, followed by what the desired output is and I'm sure there is a simple solution. SQL does recursion very well.
  4. Bobalooey

    Date format question???

    bj, Can you select some rows showing the varchar dates you speak of in SQL Query Analyzer? Then cut & paste some in a reply to this message and I've no doubt we can get you moving forward.
  5. Bobalooey

    can i backup w/ dynamic name?

    If you set up SQL to automatically backup your database on a schedule using SQL Agent, it will force a date increment in the backup file name. So the Northwind database would have backups named: Northwind_030519200.bck Northwind_030518200.bck Northwind_030517200.bck Northwind_030516200.bck You...
  6. Bobalooey

    Date format question???

    The following will show you the day of week for the current date: select datepart(dw,getdate()) as dayofweek Depending on what your SET DATEFIRST setting is, and assuming Monday has a dw value of 2, your query could simply look like this: select * from Table where...
  7. Bobalooey

    Execution of string variable containing form name

    Chip, If you have some more time ;-) do you think you could give that complete answer? The documentation for "reflection" and "callbyname" read like instructions to make plutonium. Thanks, Bobalooey
  8. Bobalooey

    Keep 2 Years Data - Account for Leap Year

    If your entereddate field is datetime, why bother converting to varchar(10). That will just slow it down. Your logic is sound, just try: SELECT * from claim where dateadd(yyyy,-2,getdate()) > entereddate order by entereddate Now the question is what are you going to do with the data that you...
  9. Bobalooey

    Update between tables

    Can you elaborate a little? What do you mean by "if something goes wrong"? If you want to make sure everything worked so that you are sure not to end up with a "bad" name, simply put the update into a transaction like: BEGIN TRANSACTION --Perform your update and check...
  10. Bobalooey

    Self-referencing Hierarchy?

    How do you want the data to display? In a tree view or hierarchical data grid, or what? Like the following I assume. Bill Gates Steve Balmer Steve Jobs Ken Levy Yedudi Menuhin The only way to get every "node" to walk back up through the tree...
  11. Bobalooey

    Hello all, im currently having an

    Ok talenx, ready for this? The only way I've ever been able to get this to work is to create a cursor from the unique values (minus the key and line number in your case), then sequentially fetch those cursor rows into memory variables and then select the "top 1 *" from my main table...
  12. Bobalooey

    Self-referencing Hierarchy?

    Assuming you want to show the parent for every child in your hierarchy, let's say your file looks like the following Employee table: id int parent_id int employee char(50) with data that looks like: id parent_id employee ------------ -------------...
  13. Bobalooey

    Trying to update a Crystal Report created from SQL database

    1.) Turn off the "Save Data with Report" switch. This will make sure your users don't get the same snapshot you made when you saved the report for the first time. This is a neat feature, but extremely annoying if not utilized properly and I believe its turned on by default. 2.) Not...
  14. Bobalooey

    Using Variable Tables in SQL2

    I believe that instead of trying to define a T-SQL variable (@loop) as a table, you want to try "Create Table" instead. Use #Loop as your table name if you want to consider it as a temporary table. The table #Loop will be automatically dropped once your SQL Connection is dropped. [b]...
  15. Bobalooey

    Decimals Not Showing .00

    Try this experiment, view some of the offending data under SQL Enterprise Manager. I'll bet you see the amounts with the trailing zeroes missing. Now query the same table from the SQL Query Analyzer and I'll bet you the numbers are now padded to the right to fill up the decimal positions. How...
  16. Bobalooey

    MS-SQL database performance stinks

    You say both databases are running on the same server, but are they both running under the same SQL instance? If not, you may have network protocol variances. One that has plagued me would be that the fast instance was running under TCP/IP and the slow performer was running under Named Pipes...
  17. Bobalooey

    Printing to a DotMatrix Printer

    While you have your report open for editing, click on File, Printer Setup and define your paper settings right there and save the report. It will retain those settings.
  18. Bobalooey

    Update each row in a query with information from a different table

    Anna, The followng should work 1. select ITEMNUMBER from Table1 group by ITEMUNMBER having count(*) > 1 This gives me a list of the duplicate records in Table 1. This works fine, but I somehow need to include it to exclude these items when I run the update. First isolate those ITEMNUMBER's...
  19. Bobalooey

    Printing to a DotMatrix Printer

    You create Dot-Matrix reports in Crystal like you would for any other type of printer. Just go sparingly on graphics, and keep your fonts to those embedded within the printer. You need to define the printer to your system before you create the report, that's it. Tell us more if your questions...
  20. Bobalooey

    Execution of string variable containing form name

    This should be the easiest thing to do. In a SQL Server table, I store menu information that is later shown in a tree-view control on a winform. The menu shows the names of forms that can be invoked. One of the columns contains the names of the various forms that can be executed (shown). These...

Part and Inventory Search

Back
Top