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...
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...
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...
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...
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)...
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...
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...
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...
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...
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]...
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...
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...
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...
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.