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 SkipVought 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. sparkyrose

    Excel Set ActivePrinter to computer's default printer

    Simple yet brilliant. Thanks. For the benefit of others, this is what it came up with: Application.ActivePrinter = "HP LaserJet 2420 PCL 5 on Ne03:" Selection.PrintOut Copies:=1, ActivePrinter:= _ "HP LaserJet 2420 PCL 5 on Ne03:", Collate:=True Note that the recorded macro may...
  2. sparkyrose

    Excel Set ActivePrinter to computer's default printer

    Hi all, I have a simple one-liner that I use to print highlighted selections from worksheets, and I want these to always print to my local printer (which is also the default printer). The problem I have is that if I have previously printed to another printer, that is the ActivePrinter, and my...
  3. sparkyrose

    Create Function for computed column

    Perfect! Much better than breaking mo and yr to separate columns as I had thought of. I think I'm good to go now, thanks for your help!
  4. sparkyrose

    Create Function for computed column

    Here is a sample: Currenttermend RenewalPeriods RenewPeriodLen Leaseend 31-May-16 0 0 31-May-16 31-Oct-14 1 2.83 31-Oct-16 30-Sep-14 0 0 30-Sep-14 15-Dec-14 1 5 15-Dec-19 22-Dec-29 2 5 22-Dec-39 29-Sep-29 2 5 29-Sep-39 The columns are off but I think you can see what should be where. In the...
  5. sparkyrose

    Create Function for computed column

    I encountered one problem in that I didn't realize that DateAdd can only handle an integer as the number. I have renewal period of less than a year. I could break the field into two (years and months) or potentially even three (days too) but this would make the form not very user-friendly. Any...
  6. sparkyrose

    Create Function for computed column

    Hi George, Firstly, thanks for the really thorough response. Lots for me to digest. You're correct that I don't need a function, and in fact, it's even simpler than that. I realized after reading your post that I could simply take DateAdd(Year, Coalesce(RenewalPeriods * RenewPeriodLen, 0)...
  7. sparkyrose

    Create Function for computed column

    Hi All, I'm trying to create a UDF (SQL Server 2000, btw) which will take the date from a column in the same table, add years based on a calculation of two other columns, and arrive at the final date. If it's helpful to know I'm taking the end of a current lease, adding the renewal options...
  8. sparkyrose

    convert string data to datetime

    Such a little thing! It all works fine now I think. Thanks to everyone who offered their thoughts!
  9. sparkyrose

    convert string data to datetime

    So I tried troubleshooting and there is no dodgy data. It made me think, however, maybe a better solution would be to add the data to a 'holding' column as varchar and then make a computed column with a user-defined function to convert it to Datetime. So my UDF is: CREATE FUNCTION...
  10. sparkyrose

    convert string data to datetime

    Thanks for the replies. The error message is as follows: "The number of failing rows exceeds the maximum specified. TransformDateTimeString 'DTSTransformation_7', column pair 1(source column 'Perpost' (DBTYPE_STR), destination column 'Datepaid' (DBTYPE_DBTIMESTAMP)): Cannot parse data string...
  11. sparkyrose

    convert string data to datetime

    Hi, Had a delay on this problem; thanks for the replies. Unfortunately neither of the above suggestions worked in our environment. The DTS Package preview produces the right data, but when the package runs it fails. The original data type is String and the destination is Datetime. Would it...
  12. sparkyrose

    convert string data to datetime

    Hi, I have some date data in one Db in the non-date format yyyymm. I need to copy some of it on a regular basis to another table where the destination column data type is Datetime. I'm trying to use a scheduled DTS Package to perform this task with the following code: SELECT [Acct]...
  13. sparkyrose

    251 Character limit on text filed after 'min of' query

    Thanks for the reply. I'll see if I can get that to work
  14. sparkyrose

    251 Character limit on text filed after 'min of' query

    Hi there, I have a query that is itself based on two other queries. I was getting multiple hits of certain data due to there being a 2008, 2009, 2010 instance of certain records, so I applied a 'Min of' to the date field. I have a separate text field in the same query which displayed all text...
  15. sparkyrose

    Link to SQL server with Bigint field

    My solution to this problem is kind of a fudge and will only work in certain situations. I also couldn't alter the SQL database, but could create my own Db on the server. I made a 'dummy' copy of the table with the Bigint PK but made the datatype 'Float'. I find I am able to copy the data...
  16. sparkyrose

    SQL ODBC DTS

    Thanks for the reply. I have tried Int too but with no success. Is there another function other than CAST that would be better?
  17. sparkyrose

    SQL ODBC DTS

    Hi, I'm fairly new to SQL Server, so apologies if this is a no-brainer. I have a SQL Server Database, with Access front end, linked through an ODBC connection. (call this "My Db") I wanted to link a table from another Db (which is on the same server as my Db) directly to Access but can't...

Part and Inventory Search

Back
Top