10/28/09
VBA function to count # of days between two dates
For i = 0 To DateEnd - DateBeg If Weekday(DateBeg + i) = D1 Then Cnt = Cnt + 1 Else End If
If Weekday(DateBeg + i) = D2 Then Cnt = Cnt + 1 Else End If
If Weekday(DateBeg + i) = D3 Then Cnt = Cnt + 1 Else End If
If Weekday(DateBeg + i) = D4 Then Cnt = Cnt + 1 Else End If
If Weekday(DateBeg + i) = D5 Then Cnt = Cnt + 1 Else End If
If Weekday(DateBeg + i) = D6 Then Cnt = Cnt + 1 Else End If
If Weekday(DateBeg + i) = D7 Then Cnt = Cnt + 1 Else End If
Next i
DayCount = Cnt
End Function
10/23/09
Interview Questions from Employers
The underlying purpose of all questions is to probe or explore your personality, attitude, or behaviour characteristics to gauge if you will be a good fit. Before going to interviews, always take the time to think of questions that you may be asked and compile a list of responses. Remember that most interviewers will be looking for three things when you answer questions:
your answer;
how well you can organize your thinking; and
how well you express yourself.
“Breaking the Ice” Interview Questions
Painting (or whatever you wrote in your resume) has always intrigued me. How did you become interested in it?
The campus looks very busy. How is your semester going?
I see you are involved in sports. How is your season going?
I have an extra hour and it's my first visit to the area. What should I see?
Work History Interview Questions
What were your responsibilities? Which was most / least rewarding?
What were your expectations for the job and to what extent were they met?
What were your starting and final levels of compensation?
What major challenges and problems did you face? What was your toughest job assignment?
How would you evaluate your present firm?
What were your biggest accomplishment / failure in this position?
What was it like working for your supervisor? What were his strengths and shortcomings?
What did you like the most and least about your previous job?
What mistakes have you made in your career? How did you fix them?
Would you describe a few situations in which your work was criticized?
Why are you leaving your job? Why are you looking for a new career? Why did your business fail?
Why were you fired? Why have you not obtained a job so far?
Why are you not earning more by now?
Have you helped increase sales? Profits? Reduce costs?
Where do you relate best - up one level, down one level, or with your peers?
What do your subordinates think of you?
How do you evaluate your subordinates?
Describe a situation in which you and a co-worker have disagreed. How did you work it out?
Have you ever taken charge as a leader in a work situation without being formally assigned to that role by your boss?
Have you ever gone beyond the call of duty in helping a client?
How many hours do you normally work?
How would you describe the pace at which you work?
What were you doing during the period of time not covered in your resume?
Have you kept up in your field with additional training?
Personal and Motivational Interview Questions
Tell me about yourself. How would you describe your own personality?
Can you describe yourself using one-word adjectives?
How do you handle rejection?
Who or what had the greatest influence on your life?
What are some of the greatest personal challenges you have faced during your lifetime?
What are some of your personal goals and have you achieved them?
What satisfies you, bothers you, or motivates you?
List three personal attributes that you would like to improve? Have you made any efforts to improve in these areas?
How would others describe your weaknesses?
What are your greatest achievements at this point in your life?
What accomplishments are you most proud of?
What are your strong points? What are your weak points?
Work-Related Interview Questions
Have you worked under deadline pressures? Provide examples.
How do you handle stress and pressure?
Can you discuss a time when you had to perform multiple tasks on very strict time lines? How did you ensure everything was completed on time?
Can you describe a typical work week?
What have you done that shows initiative and willingness to work?
What are the most important rewards you expect in your career?
What do you look for in a job?
What do you find are the most difficult decisions to make?
If you could start again, what would you do differently?
If the people who know you were asked why you should be hired, what would they say? How would your colleagues describe you? How would your boss describe you? How would you describe yourself?
Do you prefer to work independently or on a team? Give some examples of team work.
How do you build a team under you?
What type of work environment do you prefer?
Can you describe a difficult work situation / project and how you overcame it?
How do you evaluate success?
Can you describe your ideal work environment? What kind of people do you enjoy working with?
How would you handle an upset customer / client?
What is the difference between a good position and an excellent one?
What is your philosophy of management?
How has your early career or background influenced your progression and current management style?
How has your management style changed in the last ten years?
Can you discuss some of your past leadership roles?
How do you rate yourself as a professional? As an executive?
Can you discuss the importance of your job as it relates to your family?
What was the most difficult ethical decision you have had to make? What was the result?
How do you show your anger or frustration?
What is the worst situation you have faced in your professional life? How did you deal with it? What happened?
Are you a leader? A good manager? Analytical? Give an example we can verify.
Have you fired people? When and why?
Will you be out to take your boss’s job?
Can you tell me about someone who has influenced you personally or professionally?
Have you ever stolen anything from a company?
Can you tell me about the last time you broke the rules?
What is the funniest thing that has ever happened to you?
What was the worst career mistake you have ever made and what have you learned from it?
Position-Specific Interview Questions
What interests you about this job? What prompted you to apply with our company?
What do you know about this company?
Why do you want to work for this organization?
Why are you the best person for the job?
What can you do for us that someone else cannot do?
In what ways do you think you can make a contribution to our firm?
How long would it take you to make a contribution to our firm?
What qualifications do you have that makes you think you will be successful in this business? Why should we hire you? Why should we hire you instead of any of the other well-qualified candidates?
Do you prefer large or small organizations? Why?
What interests you most about the position we have? The least?
What challenges are you looking for in a position?
Is there anything I haven't told you about the job or company that you would like to know?
What business, credit, or character references can you give us?
How long do you expect to work here? When will you know when it is time to leave?
Would you object to working for a woman?
Do you generally speak to people before they speak to you?
Do you not feel you might be better off with a different size firm than ours?
What do you think it takes to be successful in an organization such as ours?
In what ways do you think you can make a contribution to our organization?
Have you ever been a member of a union? Worked with union members?
Are you willing to work overtime?
What type of work environment are you most comfortable with?
Why do you think you might like to live in the community in which our organization is located?
Can you list five things about yourself that would make you an asset to any organization that hired you?
In addition to your educational and professional experiences, what else would you like us to know about you in order to make an appropriate decision?
What kind of hours are you used to working or would like to work?
Interview Questions Related to Remuneration and Benefits
What kind of salary are you worth and why? What are your salary requirements?
What starting salary do you expect as an employee?
What company benefits are most important to you?
How do you feel about an income made up totally of commissions?
When comparing one company offer to another, what factors will be important to you besides starting salary?
How important is starting salary to you when considering our company's job offer?
Can you explain your salary history?
Relocation & Travelling Interview Questions
Are you willing to travel?
Are you willing to go where the organization sends you? Are you willing to relocate?
Do you mind traveling?
How do you feel about relocating during a career with our company?
Future Career Goals Interview Questions
What are you looking for in your next job? What is important to you?
What are your goals for the next five years / ten years? How do you plan to achieve those goals?
What are your salary requirements - both short-term and long-term?
How much money do you hope to earn five years from now?
What new goals or objectives have you established recently? Why?
What do you know about opportunities in your field?
What are the most important rewards you expect from your career?
What would you be giving up in your present job to take our position?
What position have you held that has been most meaningful to you and why?
What improvements would you have made in you last job?
What kind of challenge are you looking for?
What do you think determines a person's progress in a good company?
How do you determine or evaluate success?
What personal characteristics are necessary for success in your field?
Interview Questions Related to Education
How does your education and experience relate to this position?
Why did you not do better in college?
Can you summarize your educational background for me?
Why did you major in _____________?
What courses did you like the most? The least? Why?
Do you feel you have done the best scholastic work for which you are capable?
Can you describe your most rewarding accomplishment since you've started college?
Can you describe your study habits?
How did you finance your education?
Do you feel you received a good general education?
Why did you drop out of school?
How do you spend college vacations?
What extra-curricular activities are you involved in? What have you gained from these experiences?
Do you have plans for furthering your education?
If you could start college over, what would you do differently?
Why did you choose to major in this field of study? Why did you choose your particular college or university?
What were your favorite college courses, those you liked most? Least? Why? Please tell me about accomplishments in your academic program that are relevant to your future career goals.
What is your grade point average (GPA)? How do you feel about this? Should grades be used as an indicator of future career potential when an organization is considering new college graduates?
What were your reactions to instructors or college faculty during your academic program? How would you relate your academic accomplishments to future career aspirations? How satisfied are you with your accomplishments in this academic program?
What was the most difficult aspect of obtaining a college degree? What are your academic strengths? What courses gave you the most difficulty?
If you could, what changes would you make in your school's academic program?
Interview Questions Related to Extracurricular Activities and College Experiences
How do you spend your spare time? What are your hobbies? What was the last book you read? Movie you saw? Sporting event you attended?
How do you spend your free time? What would you do if you had more of it?
What extracurricular activities have you been involved in?
Can you tell me about your accomplishments in extracurricular activities?
What have been your greatest challenges for improvement of a campus organization? What do you enjoy doing most?
Can you describe your most rewarding college experiences?
Can you give examples of the challenges you experienced during your leadership positions with campus activities?
If you could relive your college experiences, what would you do differently?
What changes would you make in your overall campus life?
During your campus activities, what positions did you hold?
Hypothetical Interview Questions
What could you see as the major objectives of this job?
If you were hired by our organization, how would you identity the major roles and responsibilities of your new position?
What is your purpose in life?
How would you resolve conflict in a group situation?
If you were given this assignment, how would you proceed?
Closing Interview Questions
What are your salary expectations?
When can you start work?
If we invite you to our facility in [city], would you be able to come?
Is there anything else I should know about you?
Do you have any other questions?
10/14/09
Table Index Optimization to Improve Dynamics GP Performance
The code simply queries the Sales Order Processing Work (SOP10100) and Sales Order Processing History (SOP30200) tables where the ORIGNUMB = Work Order Number and then opens the Sales Order Processing Document Inquiry, sets the From and To Document Number, and sets the Unposted or History radio button accordingly. This saves the service center personnel significant time when researching work order detail for customers which increases customer satisfaction.
After 6+ years they've accumulated a little history in SOP. The code behind the inquiry buttons placed on Work Order Entry/Update window was taking too long to run. With customer service agents on the phone with customers, waiting more than a few seconds for the system to return data was too long. It didn't take long to realize that there wasn't an index on the SOP30200.ORIGNUMB column. The impact of adding that index was phenomenal reducing wait time from 10+ seconds to what seems like just milliseconds.
To create a new index in SQL Server Management Studio:
1. Right Click on the table and click Design from the menu.
2. From the Table Design menu option select Indexes/Keys.
3. Click Add to create a new index.

There is a lot of great information widely available about when and how to create new indexes. I strongly recommend you educate yourself and engage an expert to optimize your indexes.
(
ORIGNUMB
)
GO
Simple Table Backups with T-SQL
The following will select all of the data in SOP10100 into a new SOP10100_Bkup_03012009 table:
select *
into SOP10100_Bkup_03012009
from SOP10100
Remember that inserts, updates, and deletes often fire off events that could alter data in other tables. This won't backup those dependent tables so be mindful of the potential that a simple update to one table could affect data on many others.
http://mbsguru.blogspot.com/2009/03/simple-table-backups-with-t-sql.html
Custom Business Alerts
This alert, if scheduled to run periodically, will e-mail a list of users that have been logged into GP for longer than 12.5 hours or 750 minutes. It's pretty simple!
IF EXISTS
(
select datediff(mi,logindat+logintim, getdate()) as DURATION,--convert(datetime, convert(varchar(15), GetDate(), 114), 114) - LOGINTIM as DURATION,
USERID,
CMPNYNAM,
LOGINDAT,
LOGINTIM
from DYNAMICS.dbo.ACTIVITY
where datediff(mi,logindat+logintim, getdate()) > 750
)
BEGIN
DECLARE @SQL varchar(8000)
SET @SQL = 'select datediff(mi,logindat+logintim, getdate()) as DURATION,
USERID,
CMPNYNAM,
LOGINDAT,
LOGINTIM
from DYNAMICS.dbo.ACTIVITY
where datediff(mi,logindat+logintim, getdate()) > 750'
print @SQL
EXEC master.dbo.xp_sendmail @recipients = 'youralias@yourcompany.com',
@subject = 'Users Logged in beyond limit',
@message = 'Attached is a list of users that have been logged in beyond the limit',
@query = @SQL,
@attach_results = 'TRUE',
@width = 250
END
http://mbsguru.blogspot.com/2009/02/custom-business-alerts.html
Who has that record locked?
Run this against your company database to select the users which users have SOP Documents locked:
select distinct l.row_id, t.dex_row_id, t.SOPNUMBE, a.USERID
from tempdb.dbo.Dex_Lock l
inner join SOP10100 t
on l.row_id = t.dex_row_id
inner join DYNAMICS.dbo.Activity a
on l.session_id = a.SQLSESID
where right(rtrim(table_path_name), 8) = 'SOP10100'
http://mbsguru.blogspot.com/2007/12/who-has-that-record-locked.html
SQL Nugget - shortcut to create INSERT into
A slick cat we'll call Mo gave this to me. I can't take credit for it.
set nocount on
DECLARE @sTableName varchar(128)set @sTableName = '%TableName%'
select @sTableName as sTableName into #tmpTableName
DECLARE @lTableID intset @lTableID = NullSELECT @lTableID = [ID] from sysobjects where (objectproperty(id, N'IsTable') = 1) and (id = object_id(@sTableName))
if (@lTableID is Null)begin print 'Table not found! Aborting.' returnend
SELECT [name], xtype, prec, scale, colorder, isnullable into #tmpColumns from syscolumns where ([id] = @lTableID) and (colstat = 0) order by colorder
alter table #tmpColumns ADD lRowID int not null identity, -- add an identity column to the temp table sDefault varchar(40) -- add a column to store the default that we want to enter for new rowsGO
UPDATE #tmpColumns set sDefault = case xtype when 34 then ''' ''' -- image when 35 then ''' ''' -- text when 36 then Null -- unique identifier when 48 then '0' -- tinyint when 52 then '0' -- smallint when 56 then '0' -- int when 58 then '''1/1/1900''' -- smalldatetime when 59 then '0.0' -- real when 60 then '0' -- money when 61 then '''1/1/1900''' -- datetime when 62 then '0.0' -- float when 99 then ''' ''' -- ntext when 104 then '0' -- bit when 106 then '.00' -- decimal when 108 then '0.0' -- numeric when 122 then '0.0' -- smallmoney when 165 then '0' --'convert(varbinary, '' '')' -- varbinary when 167 then ''' ''' -- varchar when 173 then '0' --'convert(binary, '' '')' -- binary when 175 then ''' ''' -- char when 189 then Null -- timestamp when 231 then ''' ''' -- nvarchar when 239 then ''' ''' -- nchar endDELETE #tmpColumns where sDefault is Null--select sDefault, xtype, [name] from #tmpColumns order by colorder, lRowID
DECLARE cur insensitive scroll cursor for select sDefault, [name] from #tmpColumns order by colorder, lRowIDOPEN cur
declare @sDefault varchar(40), @sName varchar(128)declare @sWork varchar(200)declare @sWork2 varchar(100)
select top 1 @sWork2 = sTableName from #tmpTableNameprint 'INSERT into ' + @sWork2print ' ('
FETCH first from cur into @sDefault, @sNameWHILE ( @@fetch_status = 0 )begin set @sWork = char(9) + @sName
FETCH next from cur into @sDefault, @sName -- if the fetch is good, add a ',' to the end if ( @@fetch_status = 0 ) set @sWork = @sWork + ','
print @sWorkendprint ' )'
print 'select'
FETCH first from cur into @sDefault, @sNameWHILE ( @@fetch_status = 0 )begin set @sWork = char(9) + @sDefault set @sWork2 = @sName
-- get the next record from the cursor FETCH next from cur into @sDefault, @sName
-- if the fetch is good, add a ',' to the end if ( @@fetch_status = 0 ) set @sWork = @sWork + ','
set @sWork = @sWork + char(9) + '-- ' + @sWork2 print @sWorkend
CLOSE curDEALLOCATE CUR
DROP table #tmpColumnsDROP table #tmpTableName
http://mbsguru.blogspot.com/2006/04/sql-nugget-shortcut-to-create-insert.html
Find tables, with data, that have a spefic column
Anyway, I had to figure out which tables to update so I wrote a query that would return to me all of the tables, with data, that have an ITEMNMBR column:
select distinct o.Name
from SysColumns c
inner join SysObjects o
on c.id = o.id
inner join SysIndexes i
on c.id = i.id
where c.name = 'ITEMNMBR'
and o.xtype = 'u'
and rowcnt <> 0
http://mbsguru.blogspot.com/2007/12/find-tables-with-data-that-have.html
Deleting Empty Batches in SOP
DECLARE @INTERID varchar(10),
@CMPNYNAM varchar(31)
SET @INTERID = DB_Name()
SELECT @CMPNYNAM = CMPNYNAM from DYNAMICS.dbo.SY01500 where INTERID = @INTERID
DELETE SY00500
where BCHSOURC = 'Sales Entry'
and BACHNUMB not in (select BACHNUMB from SOP10100)
and BACHNUMB not in (select BACHNUMB from DYNAMICS.dbo.SY00800 where CMPNYNAM = @CMPNYNAM and TRXSOURC = 'Sales Transaction Entry')
http://mbsguru.blogspot.com/2007/11/deleting-empty-batches-in-sop.html
10/3/09
To Check or Not to Check: Understanding Landed Cost's Invoice Match and Revalue Inventory Options in Microsoft Dynamics GP
You should determine whether or not to mark the Invoice Match checkbox based on how you want your distributions to be tracked for the Landed Cost. If you do not mark Invoice Match, the distributions will be reversed from the accrued purchases account used on the Shipment – which defaults from the Landed Cost card. If you mark Invoice Match, the distributions will be created with the Purchase Price Variance account on the Landed Cost Maintenance window.
This helps you track the variances to a separate account if you want to. If you also mark Revalue IV when you mark Invoice Match, the distributions will assigned to the inventory account associated with the item the landed cost is applied to. The cost basis for the item will also be updated for any cost variance on the Landed Cost.
Example: Invoice matching and distributions for landed costs
Marking the Invoice Match option for a landed cost record will affect account distributions. For example, suppose that a shipment is recorded for 10 items at $1 each. The landed cost uses the Flat Amount cost calculation method, and the flat amount is $0.50.
The distributions for the shipment would look like this:
Inventory $10.50
Accrued Purchases - Landed Cost ($0.50)
Accrued Purchases – Inventory ($10.00)
Suppose that when the invoice is received, the cost of the goods is unchanged, but the landed cost has increased to $0.75. If Invoice Match is not marked, the account distributions would be as follows.
Accrued Purchases - Landed Cost $0.75
Accrued Purchases – Inventory $10.00
Accounts Payable ($10.75)
If Invoice Match is marked and the Revalue Inventory option is marked for the cost variance, the account distributions would be as follows:
Accrued Purchases - Landed Cost $0.50
Accrued Purchases - Inventory $10.00
Inventory $0.25
Accounts Payable ($10.75)
If Invoice Match is marked and Revalue Inventory option is not marked for the cost variance, the account distributions would be as follows:
Accrued Purchases - Landed Cost $0.50
Accrued Purchases - Inventory $10.00
Purchase Price Variance $0.25
Accounts Payable ($10.75)
Until next post!
9/29/09
Outlook Send E-mail Without Security Warning
Outlook Send E-mail Without Security Warning
If you've ever tried to send an e-mail programmatically from Access when using Outlook 2000 SP-2 or above, no doubt you will have seen this message:
This is part of the Outlook Security Model and cannot be disabled. This security 'feature' affects all Simple MAPI operations including the DoCmd.SendObject method in Microsoft Access and all Outlook OLE Automation.
Having this message pop up in an automated application is simply unacceptable for developers. Fortunately there are a few workarounds;
Create or buy an ActiveX/DLL that uses Extended MAPI to manage the creation of e-mails. The Outlook Security Model only effects 'Simple MAPI' functions not 'Extended MAPI' ones but unfortunately you can't directly interface with Extended MAPI functions from VB/VBA - hence the need for an ActiveX control or a DLL that would be written in a lower level language.
Outlook Redemption is a popular DLL solution that uses Extended MAPI.Create or buy an application that simply presses the 'Yes' button after the elapsed 5 second delay. In my opinion this is a bad idea - but if you want to follow this route, have a search around the net.
This article solution: If using Outlook 2003, the VBA code stored inside of the VBA Project of Outlook is assumed to be "Trusted" - this then bypasses the warning messages - then you can call this VBA code using automation of Outlook.
Using the trusted state of Outlook 2003 VBA code to avoid the warning messages
Requirements
Outlook 2003 (earlier versions of Outlook do not "trust" the VBA code inside the Outlook VBA Project)
Pros
Doesn't need any DLLs or external libraries
Cons
You need to add some code to the VBA project inside of Outlook
Outlook 'Macro Security' level must be set to LOW or MEDIUM
In Outlook 2003, if a MAPI MailItem object is created from within the VBA project (specifically the 'ThisOutlookSession' module), it is assumed to be "Trusted" and will not prompt the usual security messages when attempting to call the .Send method or when making use of the Outlook address book. We will be using this "Trusted" method to create an exposed Outlook VBA function that creates and sends the MailItem and then call this using Automation from our application. In our example, we will be calling the exposed Outlook VBA function from within Access. The exposed function will be called FnSendMailSafe.
Before starting, the Outlook Macro Security level must be set to LOW or MEDIUM otherwise the custom VBA function will not be exposed through automation. Furthermore, if Outlook is closed when you try to send e-mails, you will either need to set the Outlook 'Macro Security' level to LOW rather than MEDIUM, OR you can sign the VBA code with a digital certificate, otherwise you will receive a warning about unsafe macros.
Note: If you have changed the Macro Security level you must now restart Outlook.
One problem that I ran into was that when Outlook is first opened, the VBA project doesn't expose any custom VBA functions unless either a VBA event has fired, or the user has manually opened the VBA IDE. The trick I've used below is to create a blank event called Application_Startup() in the ThisOutlookSession module - this event will fire as soon as Outlook opens and so the VBA project will load properly and our function will be exposed.
Setting up the Outlook VBA code
Open Outlook
Go to the menu item Tools / Macro / Visual Basic Editor
In the VB environment expand the project node (usually called 'Project1')
Find and open the module 'ThisOutlookSession' (double click to open)
Copy and paste the code from below
Option Explicit
' Code: Send E-mail without Security Warnings
' OUTLOOK 2003 VBA CODE FOR 'ThisOutlookSession' MODULE
' (c) 2005 Wayne Phillips (http://www.everythingaccess.com)
' Written 07/05/2005
' Last updated v1.4 - 26/03/2008
'
' Please read the full tutorial here:
' http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-without-Security-Warning
'
' Please leave the copyright notices in place - Thank you.
Private Sub Application_Startup()
'IGNORE - This forces the VBA project to open and be accessible using automation
' at any point after startup
End Sub
' FnSendMailSafe
' --------------
' Simply sends an e-mail using Outlook/Simple MAPI.
' Calling this function by Automation will prevent the warnings
' 'A program is trying to send a mesage on your behalf...'
' Also features optional HTML message body and attachments by file path.
'
' The To/CC/BCC/Attachments function parameters can contain multiple items by seperating
' them by a semicolon. (e.g. for the strTo parameter, 'test@test.com; test2@test.com' is
' acceptable for sending to multiple recipients.
'
Public Function FnSendMailSafe(strTo As String, _
strCC As String, _
strBCC As String, _
strSubject As String, _
strMessageBody As String, _
Optional strAttachments As String) As Boolean
' (c) 2005 Wayne Phillips - Written 07/05/2005
' Last updated 26/03/2008 - Bugfix for empty recipient strings
' http://www.everythingaccess.com
'
' You are free to use this code within your application(s)
' as long as the copyright notice and this message remains intact.
On Error GoTo ErrorHandler:
Dim MAPISession As Outlook.NameSpace
Dim MAPIFolder As Outlook.MAPIFolder
Dim MAPIMailItem As Outlook.MailItem
Dim oRecipient As Outlook.Recipient
Dim TempArray() As String
Dim varArrayItem As Variant
Dim strEmailAddress As String
Dim strAttachmentPath As String
Dim blnSuccessful As Boolean
'Get the MAPI NameSpace object
Set MAPISession = Application.Session
If Not MAPISession Is Nothing Then
'Logon to the MAPI session
MAPISession.Logon , , True, False
'Create a pointer to the Outbox folder
Set MAPIFolder = MAPISession.GetDefaultFolder(olFolderOutbox)
If Not MAPIFolder Is Nothing Then
'Create a new mail item in the "Outbox" folder
Set MAPIMailItem = MAPIFolder.Items.Add(olMailItem)
If Not MAPIMailItem Is Nothing Then
With MAPIMailItem
'Create the recipients TO
TempArray = Split(strTo, ";")
For Each varArrayItem In TempArray
strEmailAddress = Trim(varArrayItem)
If Len(strEmailAddress) > 0 Then
Set oRecipient = .Recipients.Add(strEmailAddress)
oRecipient.Type = olTo
Set oRecipient = Nothing
End If
Next varArrayItem
'Create the recipients CC
TempArray = Split(strCC, ";")
For Each varArrayItem In TempArray
strEmailAddress = Trim(varArrayItem)
If Len(strEmailAddress) > 0 Then
Set oRecipient = .Recipients.Add(strEmailAddress)
oRecipient.Type = olCC
Set oRecipient = Nothing
End If
Next varArrayItem
'Create the recipients BCC
TempArray = Split(strBCC, ";")
For Each varArrayItem In TempArray
strEmailAddress = Trim(varArrayItem)
If Len(strEmailAddress) > 0 Then
Set oRecipient = .Recipients.Add(strEmailAddress)
oRecipient.Type = olBCC
Set oRecipient = Nothing
End If
Next varArrayItem
'Set the message SUBJECT
.Subject = strSubject
'Set the message BODY (HTML or plain text)
If StrComp(Left(strMessageBody, 6), "", vbTextCompare) = 0 Then
.HTMLBody = strMessageBody
Else
.Body = strMessageBody
End If
'Add any specified attachments
TempArray = Split(strAttachments, ";")
For Each varArrayItem In TempArray
strAttachmentPath = Trim(varArrayItem)
If Len(strAttachmentPath) > 0 Then
.Attachments.Add strAttachmentPath
End If
Next varArrayItem
.Send 'No return value since the message will remain in the outbox if it fails to send
Set MAPIMailItem = Nothing
End With
End If
Set MAPIFolder = Nothing
End If
MAPISession.Logoff
End If
'If we got to here, then we shall assume everything went ok.
blnSuccessful = True
ExitRoutine:
Set MAPISession = Nothing
FnSendMailSafe = blnSuccessful
Exit Function
ErrorHandler:
MsgBox "An error has occured in the user defined Outlook VBA function FnSendMailSafe()" & vbCrLf & vbCrLf & _
"Error Number: " & CStr(Err.Number) & vbCrLf & _
"Error Description: " & Err.Description, vbApplicationModal + vbCritical
Resume ExitRoutine
End Function
Test the Outlook code
At this point, I would recommend testing the code by sending a test e-mail from the Outlook Immediate window (Ctrl+G shortcut):
?ThisOutlookSession.FnSendMailSafe("youremailaddress@here.com","","","Test","Test")
Once you've confirmed that you have installed the VBA code correctly, it's time for the Access OLE automation...
Calling our Outlook VBA function from within Access VBA code
Open your Access database
Create a new VBA module for testing purposes
Copy and paste the code from below
Option Explicit
' ACCESS VBA MODULE: Send E-mail without Security Warning
' (c) 2005 Wayne Phillips (http://www.everythingaccess.com)
' Written 07/05/2005
' Last updated v1.3 - 11/11/2005
'
' Please read the full tutorial & code here:
' http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-without-Security-Warning
'
' Please leave the copyright notices in place - Thank you.
'This is a test function - replace the e-mail addresses with your own before executing!!
'(CC/BCC can be blank strings, attachments string is optional)
Sub FnTestSafeSendEmail()
Dim blnSuccessful As Boolean
Dim strHTML As String
strHTML = "" & _
"" & _
"My HTML message text!" & _
"" & _
""
blnSuccessful = FnSafeSendEmail("myemailaddress@domain.com", _
"My Message Subject", _
strHTML)
'A more complex example...
'blnSuccessful = FnSafeSendEmail("myemailaddress@domain.com; secondrecipient@domain.com", _
"My Message Subject", _
strHTML, _
"C:\MyAttachmentFile1.txt; C:\MyAttachmentFile2.txt", _
"cc_recipient@domain.com", _
"bcc_recipient@domain.com")
If blnSuccessful Then
MsgBox "E-mail message sent successfully!"
Else
MsgBox "Failed to send e-mail!"
End If
End Sub
'This is the procedure that calls the exposed Outlook VBA function...
Public Function FnSafeSendEmail(strTo As String, _
strSubject As String, _
strMessageBody As String, _
Optional strAttachmentPaths As String, _
Optional strCC As String, _
Optional strBCC As String) As Boolean
Dim objOutlook As Object ' Note: Must be late-binding.
Dim objNameSpace As Object
Dim objExplorer As Object
Dim blnSuccessful As Boolean
Dim blnNewInstance As Boolean
'Is an instance of Outlook already open that we can bind to?
On Error Resume Next
Set objOutlook = GetObject(, "Outlook.Application")
On Error GoTo 0
If objOutlook Is Nothing Then
'Outlook isn't already running - create a new instance...
Set objOutlook = CreateObject("Outlook.Application")
blnNewInstance = True
'We need to instantiate the Visual Basic environment... (messy)
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objExplorer = objOutlook.Explorers.Add(objNameSpace.Folders(1), 0)
objExplorer.CommandBars.FindControl(, 1695).Execute
objExplorer.Close
Set objNameSpace = Nothing
Set objExplorer = Nothing
End If
blnSuccessful = objOutlook.FnSendMailSafe(strTo, strCC, strBCC, _
strSubject, strMessageBody, _
strAttachmentPaths)
If blnNewInstance = True Then objOutlook.Quit
Set objOutlook = Nothing
FnSafeSendEmail = blnSuccessful
End Function
http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-Without-Security-Warning
9/6/09
Need to reset the SYSTEM password in Dynamics
Use Dynamics
Go
Update SY02400 Set Password = 0x9D8F0020202020202020202020202020
9/2/09
SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE
Following three questions are many time asked on this blog.
How to insert data from one table to another table efficiently?
How to insert data from one table using where condition to anther table?
How can I stop using cursor to move data from one table to another table?
There are two different ways to implement inserting data from one table to another table. I strongly suggest to use either of the method over cursor. Performance of following two methods is far superior over cursor. I prefer to use Method 1 always as I works in all the case.
Method 1 : INSERT INTO SELECT
This method is used when table is already created in the database earlier and data is to be inserted into this table from another table. If columns listed in insert clause and select clause are same, they are are not required to list them. I always list them for readability and scalability purpose.USE AdventureWorks
GO
----Create TestTable
CREATE TABLE TestTable (FirstName VARCHAR(100), LastName VARCHAR(100))
----INSERT INTO TestTable using SELECT
INSERT INTO TestTable (FirstName, LastName)
SELECT FirstName, LastName
FROM Person.Contact
WHERE EmailPromotion = 2
----Verify that Data in TestTable
SELECT FirstName, LastName
FROM TestTable
----Clean Up Database
DROP TABLE TestTable
GO
Method 2 : SELECT INTO
This method is used when table is not created earlier and needs to be created when data from one table is to be inserted into newly created table from another table. New table is created with same data types as selected columns.USE AdventureWorks
GO
----Create new table and insert into table using SELECT INSERT
SELECT FirstName, LastName
INTO TestTable
FROM Person.Contact
WHERE EmailPromotion = 2
----Verify that Data in TestTable
SELECT FirstName, LastName
FROM TestTable
----Clean Up Database
DROP TABLE TestTable
GO
Both of the above method works with database temporary tables (global, local). If you want to insert multiple rows using only one insert statement refer article SQL SERVER – Insert Multiple Records Using One Insert Statement – Use of UNION ALL.
8/31/09
How To Plant A Garden
- Locate the garden away from buildings and trees.
- Have the garden where it is convenient to your house and to water.
- The garden should be well drained but not droughty.
- Locate the garden on the best soil available -- a sandy loam soil is best.
- Protect the plot, whether large or small, with a good fence.
Size And Shape
First, think small. Don't bite off more than you can chew, or hoe. It's like starting out an exercise program by running five miles the first day. You get tired, sore and you quit. Likewise, if you plant a huge garden the first year, you'll curse, cuss and turn your sore back on gardening for good. So, if you're new to gardening, start off with a small garden. You can always expand later if you can't get enough of those fresh, crispy vegetables. Choose a location that receives as much sun as possible throughout the day. Northern gardeners should insist on full sun.Drainage
Next, examine the soil. Is it predominantly clay, sand or a sandy loam? The latter is the best. You can distinguish a sandy loam from the other two by giving it the squeeze test. If you can take a handful of dirt and squeeze it in a ball then watch it crumble when you let go, you've got a sandy loam soil type. If you're stuck with a predominantly sandy or clay soil you can amend the soil with compost.Vegetables will not grow well on poorly drained soil, even though supplied with adequate fertilizer. If your soil has a lot of clay or is poorly drained, make the beds high so they will drain quickly and the soil will warm up in the spring. You can reduce the size of the beds just before planting.
Note: Check the plot after a rain to note the low areas, which should be drained or filled in. The soil in a low area may show poor production. In some instances you may use an area too wet for the spring garden or a fall garden.
The Garden Plan
Make a garden plan and make the plan work. A good plan is a "must" for the beginner gardener. Your plan will include what vegetables to plant, which varieties to select, and their locations in the garden.Unfortunately, critters (and children) may take a shine to your new garden. Rabbits, geese and deer can be a problem. For the small garden, a wire mesh surround works well. This will discourage most critters and some people. I've seen people take chicken wire and staple it to the top of their landscaping timbers on a raised bed to keep out geese and the like. Vandals can also attack gardens, especially in conspicuous areas of a city, such as in a community garden.
Garden Practices
Every gardener wants to grow as many quality vegetables as possible with the least expense. To do this you must use good garden practices.- Prepare plot or rows during fall and winter for early spring planting.
- Use fresh seeds of recommended varieties.
- Make double-row plantings of beets, carrots, radish, mustard, lettuce, turnips, onions, English peas, and spinach in the spring garden.
- Use adequate fertilizer.
- Side dress plants with a nitrate fertilizer when the plants are 3 to 4 inches tall.
- Prune and/or stake plants that require it, such as tomatoes, pole beans, sweet pepper, and eggplant.
- Water, mulch, and harvest regularly to keep plants producing.
- Cultivate when grass and weeds are small.
- Grow two or more crops of certain vegetables on the same row at the same time.
- Control pests.
- Make at least two plantings of most vegetables for continuous production.
Soil
The better the condition of your soil, the better garden you will have! The best way is to add decomposed organic material that is worked into the soil to improve its balance, texture and water-holding capacity. Use aged manure, rotted leaves, peat moss, compost (the best!) or whatever kind of organic material is available. Building good soil is the most important task a gardener can do, and luckily there are all kinds of materials that will work. Ask your gardening neighbors or a good local garden center what is the best and most plentiful organic material to be found in your area, then really stock up. Soil is broadly defined as three types: clay, sand and loam. Most soils have some of each of these although one type often predominates. Clay soils have small particles that hold moisture and nutrients. They warm up and cool down slowly. Lighten heavy, compacted and poorly drained clay soils by the addition of compost or other organic material. Sandy soils have larger particles. They change temperature, are light in texture, and drain water and nutrients quickly. Adding compost to sandy soil helps it hold moisture and conserve nutrients. Loam is a soil type containing a combination of both types of particles, as well as plentiful decayed organic matter. It holds nutrients and moisture, yet drains well. Although this soil occurs naturally in some areas, you will want to mimic nature in your soil preparation by adding extra organic material to the soil you have to make it as close to loam as possible.Adding organic material benefits all soil types - sandy soil will hold more water and clay soil will get more "friable" or loose and less compacted. Organic material will break down over time, so add it continually to your garden. Add it before you plant each new crop as well as at the end of the season. For new beds, add 3 to 4 inches of well-rotted material and turn it into the top 4 to 6 inches of soil, chopping it up and working it in until the soil texture is as crumbly and even as possible. (To make your own compost, "a gardener's gold," order our compost making brochure or inquire about compost making workshops or information at a good local garden center or your local Master Gardener program.)
Don't concern yourself too much with the degree of acidity and alkalinity, or pH of your soil. Most common garden plants grow best when the soil is just slightly acid. If your soil is too alkaline or acidic, you can use various materials to neutralize or acidify it. Consult a local nursery to see if there are any problems in your area's soil and follow their advice. Packet backs will note if there are particular plants that have specific needs. Adding compost to any soil will also improve its chemical and mineral balance.
If your soil seems rock hard with clay or very compacted, an excellent alternative is to build raised beds or big bottomless boxes bordered with wood, cinder blocks, railroad ties, or other materials. This way you can bring in some good soil to give you excellent results in a small space. Concentrate on adding a lot of decomposed organic material to your raised beds, even purchasing some bags of planting mix to fill them, so you can plant right away and have good crops the first season. Then you can work on improving a larger area for your garden over time. If gophers or moles are a problem in your area, the raised beds can be underwired with galvanized 1/2 inch chicken wire or hardware cloth. Just tack the sheets of wire to the bottom of the bed boards after excavating soil, then fill the frame back in.
Another alternative if your soil is poor, or if you have limited sunny space, is to plant in containers. There are all kinds to choose from; plastic or clay pots or wooden planters in many shapes and sizes. In general get the biggest ones that are practical for you so your plants will have plenty of root room, and because larger pots dry out more slowly. For good sized plants like tomatoes or peppers or large flowers, depth should be 12 to 18 inches. Smaller plants like herbs, lettuce, and more compact flower varieties can grow in smaller pots. The most important things to remember when gardening in containers is that the soil mix must have a good loose texture that will hold moisture and won't pack down over time. You can buy many good brands of premixed planting mix from your local garden center to fill your containers. Don't use your garden or yard soil as it will get too compacted for good root growth and the moisture won't wet it evenly. Remember that you will be supplying all the food and water to plants in containers since their roots aren't in the ground where they can reach for nutrients and water in a larger area. Good moisture retention is critical, as is good drainage, so plan to fertilize and water all container plants very regularly.
Making The Garden Bed
Once you've decided on the size and location of your new garden, early spring weather has arrived, and the soil is ready to work, the first outdoor task is to prepare the garden soil. Mark out the garden area and using a digging fork, garden spade, shovel, or a rototiller, (convenient and fast, but not critically necessary), loosen the soil to a depth of 12 to 18 inches. If you live in an area where your soil is very dry, water first to make it easier to work, but make sure you don't ever dig when the soil is too muddy. Turn over the soil 7 to 10 inches deep and break up the clumps, removing rocks, branches and weeds. Mark out paths so you can make "beds" where plants are to grow. As noted above, two to three foot wide beds make ample planting areas and they are not too wide to reach across from both sides to weed, water or harvest. Once you have worked up your soil, walk only on your paths so you don't compact the soil and lose the nice fluffy quality you are working to create in the planting areas.Fertilizing
Most vegetables are heavy feeders and require a soil well supplied with plant food and organic matter. Do not attempt gardening without using fertilizer. Do not use fresh manure during the growing season because it may burn young plants. Do not use fresh leaves except as mulch. Compost also works well as a side dressing material.Now add a layer of 3 or 4 inches of well-rotted organic material to the beds and turn it in until it is as crumbly and even as possible. At the same time you can incorporate other fertilizers. Especially in new gardens, the organic material you've added won't supply enough nitrogen soon enough to feed your first plantings. Follow fertilizer package instructions and work in well to the top 4 to 6 inches of soil of the bed so it will be available to the shallow feeder roots of young seedlings. Finally, smooth the surface of the soil with a rake to make a fine-textured seed bed. The goal is to have finer soil on the top and coarser down below, providing for good water percolation and drainage.
Although it may still be too chilly to plant your warm weather crops in early spring, go ahead and prepare the soil for them at the same time you are digging and fertilizing the other beds and getting ready to plant your cool season varieties. This will give you a head start and will also let some early weeds germinate which can be scraped off with the rake when you are ready to plant. This will result in less weeds to come up later with your summer sowings.
The three nutrients used most by your plants are the so-called macronutrients, Nitrogen (N), Phosphorus (P), and Potassium (K). Nitrogen stimulates green leaf growth and form's proteins and chlorophyll. Phosphorus contributes to root, flower and fruit development, as well as disease resistance. Potassium promotes stem and root growth and the synthesis of proteins. Well-made compost will supply most of these needs. You can also add slow acting soil feeders such as bone meal and cottonseed or blood meal, or use commercial granulated fertilizers in preparing the soil for planting. Be sure to follow directions for amounts to add; more is not necessarily better.
It will pay to use a balanced commercial fertilizer in the rows 10 days to 14 days before planting. This type of fertilizer (13-13-13 or 8-8-8) contains the three basic materials necessary for plant growth -- nitrogen, phosphorous, and potash.
Use a balanced fertilizer such as 13-13-13 at the rate of 3 to 5 pounds per 100 feet of row. Spread it over the row and mix it 4 to 5 inches deep. The exact amount to use for each vegetable is determined by the kind of vegetable grown. Leafy vegetables usually require more fertilizer than pod vegetables.
Preparing The Rows
Preparation of the spring garden should start in the fall or winter before. The first step is to clean out the plot. Remove all grass, weeds, vines, and plant stubble. Spread the usual fall application of barnyard manure or compost over the plot and hoe under.How will you arrange the plants in your garden? For many vegetables, we recommend planting in wide rows or beds. Planting beds 3 feet wide are easy to reach into from either side. Make wide enough walking paths so you can move around the plants easily to water, weed and harvest. Some crops, like corn and potatoes are often planted in blocks. Plant corn in a block with at least 4 rows side by side rather than one long row because it is pollinated by the wind rather than by flying insects. When the tassel at the top of each plant is full of pollen, the wind must shake down showers of it to fall on the silks emerging from each tiny ear or you won't get well-filled out, plump ears. Sprawling plants like melons and squash are sown in well-enriched, slightly mounded planting circles called "hills" with about 4-6 feet of space between each hill for the vines to grow into.
If you make the rows by midwinter, the winter weather will help in having a loose soil for early spring planting. When planting time comes in the early spring, all that will be necessary before planting is to "freshen up" the top of the rows for planting small seeds. If rows are too low after the winter rains, remake them and allow time to settle before planting.
Cultivation
The chief purpose of cultivation is to keep down weeds and grass. Cultivate shallow and as often as needed. There is no set time to do this job, but the best time is while the grass and weeds are small.Seeds
Select seed varieties that do well in your area and plant fresh seeds each year. Seeds more than one year old, bought or home-saved, should be tested before planting. If you're unsure of the quality of your seeds, do a germination test before using them. Place 10 to 20 seeds from a packet between moist pieces of paper towels inside a plastic bag. Place the bag in a warm location (70 to 90 degrees F). If more than half the seeds germinate within a week or two then you can be assured that the seeds are good. Buy seeds from a reliable seed dealer and get enough for at least two plantings. Getting your seeds early will insure your getting the varieties you want.Now you have laid out the soil in your garden site with delineated walking paths and planting beds that have a fine, smooth surface. The soil is loosened down deep so the plant roots will be able to extend easily in all directions to find nutrients, and water will percolate down well. The top surface of the soil is very fine and flat so tiny seeds won't fall down in between clods where they will be buried too deeply to germinate.
Now it is time to put the seeds in the ground, or "sow" them. You can sow seeds in rows in the beds or broadcast them in a wide swath covering the whole bed. To sow seeds in rows, first read the packet backs of the individual varieties to get an idea of how far apart rows should be and how far apart seeds should be spaced in the rows. Make shallow furrows in the soil about 1/2 inch deep and a few inches apart using a stick or the handle of a rake or hoe. Then empty some seeds from the packet into the palm of your hand, and closing the palm gently, turn your hand over and let the seeds fall out slowly, using your thumb and forefinger to direct them into the furrow. This is a little quicker than picking up each seed and dropping it in one at a time. Never put all the seed in your hand at once in case of accidents or mistakes.
Move slowly along the path and try to sow the seed as thinly as possible. Don't worry if it seems like you're dropping too many, this is a learned skill and you'll get better with practice. Then pull in the soil from the sides of the furrow and crumble it in to cover the seeds. Generally you should cover relative to the thickness of the seed; tiny seeds should be covered very lightly, larger seeds more thickly. Packet backs tell you how deep to plant seed and also tell you which seeds should have the soil firmed over them because they need especially good soil contact. (Beets and chard are two examples of irregularly shaped seeds that need firm soil contact for good germination.)
With great big seeds like peas, beans and corn, you use a different sowing method. It is easier to place them on the soil first to space them, then poke them into the soil, filling in the poke holes as you go by smoothing the soil in the bed with your hand to level it out. Some packet backs recommend sowing seeds in the entire wide bed instead of in single rows. This works very well for root vegetables such as beets and carrots, and salad crops and greens because you can take advantage of planting space if you don't have to leave walking paths between each row. Also as you harvest each plant, the leaves of the ones next to it will grow and fill in the space, shading the soil from drying by the sun. Note: Be sure to mark each row or bed with the name of the plant sown there and the date.
Cover freshly sown seeds with fine soil or use prepared soil mix for a more water-retentive material. To cover seeds sown in a bed, sprinkle the soil lightly over them about 1/4 to 1 inch deep according to the thickness of the seed. Consult packet backs for specifics. Water gently and carefully with a fine spray at this stage to avoid washing the little seeds from their soil bed. Seeds need even and constant moisture to germinate and the topmost layer of the soil bed may dry out if there are no rains and the weather warms up in the day. Check the surface of the bed carefully every day to see if it is evenly moist until the seeds are all germinated and growing well; it really pays to give extra attention to this vulnerable germination period.
In dry hot climates you will probably need to water twice a day. It is best to sprinkle after the sun is up in the morning and not too late in the evening to keep water from over-chilling seedlings at night. Use a hose attachment with a fine spray or a gentle sprinkler to irrigate seed beds. Tiny seeds that are sown close to the surface, like carrots, are especially susceptible to germination problems if the top inches of soil are not kept evenly moist.
You'll always start by sowing many more seeds you actually plan to let mature. This is because not every seed germinates even in ideal conditions, and you want extra seedlings "for insurance" to cover inevitable and ordinary losses to inclement weather or pests like insects, deer, birds or rodents. Also, you'll be choosing only the best and healthiest plants to grow to harvest; this important process of selection is called "thinning out" and is a very important part of successful gardening. Many customers ask how to store leftover unused seeds. Most varieties will keep easily for the next growing season provided they are kept cool and dry. Never leave seed packets outside in the garden or in an unheated garden shed or garage, because high humidity and dampness will ruin them. A sealed mason jar or ziplock bag is an ideal storage container. Keep seeds in your coolest room, or better still, in a refrigerator and plan to use them the next season.
Times For Seed Germination In Warm Moist Soil | |
| Plants | Days |
| Beans | 5 to 10 |
| Beets | 7 to 10 |
| Cabbage | 5 to 10 |
| Carrots | 12 to 18 |
| Cauliflower | 5 to 10 |
| Corn | 5 to 8 |
| Cucumber | 6 to 10 |
| Endive | 5 to 10 |
| Lettuce | 6 to 8 |
| Onion | 7 to 10 |
| Peas | 6 to 10 |
| Parsnips | 10 to 20 |
| Parsley | 15 to 21 |
| Pepper | 9 to 14 |
| Radish | 3 to 6 |
| Spinach | 7 to 12 |
| Salsify | 7 to 12 |
| Tomato | 7 to 12 |
| Turnip | 4 to 8 |
Plants
Seed boxes are used for growing early plants while you wait for good weather for planting outdoors. You can start plants such as tomato, pepper, and eggplant from seeds planted in small wooden boxes. Grow the plants for 7 to 8 weeks in the seed box and then set them in the open. You want to set only the healthy, strong plants.Mulches
Are the weeds growing just as fast, or even faster, than your vegetables in the garden? Weeds can make the vegetable garden an unsightly place to visit and will reduce the quality and quantity of your harvest.Mulching is an option to routine cultivation and hand pulling of these volunteer plants. Mulching involves covering the soil around the vegetables so that light cannot reach the soil surface. When done correctly, this eliminates all but the most persistent weeds.
Many different materials can be used around vegetables. Black plastic is most effective around large and widely spaced plants, such as squashes, tomatoes, eggplant and peppers. And these crops really benefit from the weed control and extra warmth the black plastic provides. However, black plastic also provides an ideal environment for slugs. During wet growing seasons, these pests can present problems almost equal to that caused by weeds.
Organic alternatives to plastic mulch include herbicide-free grass clippings, weed-free straw or the white pages of the newspaper. Organic mulches help moderate soil temperature, reduce evaporation from the soil, and can be incorporated into the soil or placed in the compost pile at the end of the season as a source of organic matter. Because of their soil improving capability, organic mulches are recommended. Grass clippings and straw can be placed around all established plants easily and quickly. Newspaper sections must be anchored to the soil with rocks or soil to hold it in place.
For best results, remove all weeds from the garden prior to mulching. Thoroughly irrigate the garden prior to putting the mulch in place or time its placement after a soaking rain. If your choice is black plastic, cut slits in the sheeting to allow for air and water movement into the soil. Carefully anchor the plastic to the soil prior to planting the garden area. Grass clippings and straw will need to be spread at least 2 inches thick to be effective. And, these mulches will need to be replenished during the season as they decay.
Irrigation
There is no set time to water the garden. Just be sure the leaves are dry when the sun goes down. If you row water, drip irrigate, or flood the garden, it can be watered at any time. If you sprinkle, be sure to turn off the water at least 2 hours before sundown. Apply at least 1 inch of water per week when it doesn't rain.Insects
Watch for insect infestation. If things are properly spaced in your garden, insects shouldn't be a big problem. If you do see evidence of chewing on plants, especially things like cabbage, don't wait to fight back. Identify the insect causing the damage and choose an insecticide or insecticidal soap that will control that specific insect. Proper spacing, weeding and fertilizing is a good way to prevent disease and insect infestation without having to resort to harmful insecticides.Crop Rotation
To reduce the likelihood of plant diseases becoming a problem in your vegetable garden, do not grow the same crop in the same area of your garden each year. Rotate the crops by family and not by individual vegetable. Plant related crops (crops in the same family) in the same place only once every three or four years. For example, follow your tomatoes with peas or pole beans, followed by trellised cucumbers or squashes the second year, sunflowers the third year, and then back to tomatoes, peppers, eggplant, potato, or tomatillo.Harvesting Vegetables
One of the major benefits of growing your own vegetables is being able to harvest them when they're fully ripe and at their peak of freshness. In general, the best time to harvest is in the morning just after the foliage has dried. The plant has just had the night to recover from heat and water stresses common during summer days. Fruits and vegetables will be at their top quality then. Cooler temperatures in the morning also make the job less stressful for the gardener. Once harvested, don't let vegetables sit in the sun. Move them indoors as quickly as possible.Know Your Vegetables
Vegetables may be classified by their resistance to frosts and cold. By knowing this, you can tell what and when to plant for best production. The four general groups of vegetables are hardy, half hardy, tender, and very tender.Vegetables in the hardy group can withstand hard frosts and can be planted 2 to 3 weeks before the last killing frost in the spring or as soon as the soil can be prepared. The half-hardy group contains vegetables that can withstand light frosts. The seeds will germinate at low temperatures. These vegetables are planted about the time of the last killing frost.
Seeds of cool season plants can sprout or "germinate" when the soil is still cool; you don't have to wait until the nights warm up and they can handle some spring frosts. It is time to prepare the garden for planting cool season crops in your area when the soil is "ready to work". This means in early spring when the earth is no longer frozen in northern climates, and in milder areas when heavy spring rains have subsided and soil is no longer muddy or sodden. Crops that are best started in the earliest spring weather are all the leafy greens and salads such as lettuce, spinach, chard and oriental greens, and the brassica family which includes broccoli, cabbage, cauliflower and kale.
Radishes, peas and turnips can be planted in cool weather too. A few weeks later, plant root crops like carrots and beets. All these vegetables not only germinate and grow best when the soil is still cool, but they give the best tasting harvests if they can make their growth before the weather gets too hot.
There are also some vegetables that can be planted in both cool and warm seasons, such as chard and beets; you can sow them in spring for summer harvests, then again in late summer. There are some warm season, heat loving plants like tomatoes, eggplants and peppers that will always need to be started from seeds in containers indoors instead of planting the seeds outside in the garden. This is because they require a very long growing season.
Warm Season Crops | |
| Tender | Very Tender |
| Beans (snap) | Beans (lima) |
| Corn (sweet) | Cucumbers |
| New Zealand Spinach | Cantaloupe |
| Tomatoes | Eggplant |
| Pepper | |
| Pumpkin | |
| Squash | |
| Sweetpotato | |
| Watermelon | |
| Okra | |
Cool Season Crops | |
| Hardy | Half hardy |
| Asparagus | Artichoke |
| Brussels sprouts | Beets |
| Broccoli | Carrots |
| Cabbage | Cauliflower |
| Chinese Cabbage | Celery |
| Collards | Endive |
| Garlic | Lettuce |
| Kale | Parsnip |
| Kohlrabi | Potato, Irish |
| Mustard | Salsify |
| Onion | Swiss Chard |
| Parsley | |
| Peas (English) | |
| Radish | |
| Rutabaga | |
| Spinach | |
| Turnips | |
Vegetables And How To Grow Them
Asparagus variety--Mary Washington. Plant crowns or roots in winter or early spring, setting roots 18 inches apart in 3 1/2- to 4-foot rows. Use plenty of well-composted organic matter. Open trench in rows 6 inches deep and 12 inches wide. Spread roots carefully, then fill in over each crown with 3 to 4 inches of loose, fertile soil. Cultivation must be shallow.Do not cut asparagus for table use the first spring, though you may expect a light cutting the second year. Cut for 4 to 5 weeks, then let stalks grow. After frost each fall, cut tops, remove them from garden, and burn. Cover beds with 3 to 4 inches of barnyard manure in late fall.
Beans, bush snap. This vegetable will produce in 55 days. Make plantings every 10 days to 2 weeks from March to May and one fall planting in August. Distance between rows should be 24 to 36 inches. Plant seed in continuous row with seeds 2 inches apart in row. Cover seeds 1 inch deep. Dust for bean beetles. Do not cultivate or pick beans when plants are wet.
Beans, pole snap. Make at least three plantings from April to August. Space rows 3 to 4 feet apart. Drop seeds three per hill in hills 18 inches apart or plant in continuous drill with seeds 6 to 8 inches apart.
Provide poles or wire and string for vines before they begin to climb.
Beans, bush lima. Make a planting every 4 to 5 weeks from April to August. Plant as recommended for bush snap beans.
Beans, pole lima. Make at least two plantings from April to mid-July. Plant, thin, and support as for pole snap bean.
Beets. Plant any time from February to April for spring crop, in late August or September for fall crop. Rows should be 24 to 36 inches apart. You can use double rows 10 inches apart, with each double row 36 inches apart, if space is limited. You can also do this with carrots, lettuce, onions, radishes, English peas, and other early crops.
In planting beets, open a shallow drill (trench), sow two or three seeds to each inch of row, and cover 1/2 inch deep. When plants are 3 inches tall, thin to a spacing of 4 inches. Plants removed can be reset if they are needed.
Cabbage. Buy healthy plants for spring planting. Set in rows 24 to 36 inches apart, spacing plants 12 inches apart in row. May be planted from January to April. Feed cabbage plenty of nitrogen. Side dress with 1 pound ammonium nitrate to each 100 feet of row when plants are well established.
Carrots. Plant spring crop from February through April; fall crop in August, September, and early October. Sow seed, placing four to six seeds to the inch. A few radish seeds mixed with carrots in seed row will mark row and help carrot seedlings through ground. Thin carrots to stand 2 inches apart.
Chard, Swiss. Plant like beets, but thin plants to 12-inch spacing when 3 inches tall.
Collards. Sow seed in spring or fall. Thin to 15-inch spacing. Fertilize with ammonium nitrate as for cabbage.
Corn, sweet. Do not save seed. Make at least four plantings, beginning in March. Plant 2 to 3 weeks apart. Plant three seeds to a hill 12 inches apart and thin to one stalk per hill. Fertilize heavily. Do not pull suckers.
Cucumbers. Plant seed in continuous drill with seeds 9 to 12 inches apart. Water if possible in dry weather. Pick regularly.
Eggplant. Sow seed in seedbox or hotbed in January or February. Set in garden after danger of frost is past, spacing plants 18 to 24 inches apart.
Lettuce, head. Plant in January or February in seedbox, if necessary. Transplant or thin plants to spacing of 12 inches. Lettuce needs rich soil.
Lettuce, leaf. Sow in January, February, March, or April. Thin to 4-inch spacing. Make fall planting in August or September.
Mustard. Sow every 3 or 4 weeks in February, March, and April and again in August and September. Thin plants to 1-inch spacing. Eat plants pulled in thinning.
Okra. Plant after danger of frost is past, sowing seed thick enough to assure a stand. Leave plants 18 inches apart. One planting will bear until frost.
Onion. Buy plants or sets or get sets of multipliers from your neighbors. Plant in garden in early spring, spacing onion plants or sets 3 inches apart. Thin those to store to 6 inches apart, eating green onions that are removed. Use rich soil for onions. Cultivate often and shallow. Pull to store when tops die down.
Peas, English. Plant several varieties from January to April. Sow seed 1 inch apart in double rows 12 inches apart and place support of brush, wire, or string, between each double row.
Pepper, hot. Plant seed in January or February in seedbox or hotbed. Set plants 2 feet apart in row after danger of frost is past. Six to 12 plants are enough.
Peppers, sweet. Cultivate same as for hot pepper. May need to stake large plants. Stake like tomatoes.
Potato, Irish. Plant spring crop in January, February, and March, and fall crop in August. Cut seed pieces with two eyes, the size of an egg or larger, and plant 6 inches deep 12 inches apart. Use potatoes from spring crop for fall crop, sprouting seed in July under moist sacks, straw, or soil. Plant 5 to 6 inches deep in August.
Radish. Plant 10 to 15 feet of row every 2 weeks in February, March, and April, also in September and October. Sow seed 1/2 of an inch apart and 1/2 of an inch deep. Thin to 2 inches.
Spinach. Plant any time in winter between October and March. Sow 1 inch deep and thin plants to 3 inches apart. Use ammonium nitrate as side dressing when plants are 2 inches tall.
Squash. Sow two to three seed in hills 36 inches apart. Thin to one plant after the danger of frost is past.
Tomato. Sow seed in seedbox or hotbed in February or March. Transplant to plant boxes or cold frame when 2 to 3 inches high. Set plants in open garden after danger of frost is past. Set plants in rows 3 to 4 feet apart with plants 18 to 36 inches apart in row. Prune early crop to one or two stems and tie to a 5-foot stake. Do not prune the fall crop as heavily. Sow seed in June for fall crop. Mulch tomatoes in June.
Turnip and tendergreen. Plant February to April and for fall garden in September. Sow seed 1/2-inch deep in rows or broadcast over wide bed.
Watermelon. Plant seeds in April and May, six to eight seed in hill, 6 feet apart in rows 10 feet apart. Thin plants to two to hill.
Distance Between Plants In Row
| Plants | Inches |
| Asparagus | 18 |
| Beans bush, snap | 3 to 6 |
| Pole, snap | 4 to12 |
| Bush, lima | 3 to 6 |
| Pole, lima | 4 to12 |
| Beets | 2 |
| Chinese cabbage | 12 |
| Cabbage | 18 |
| Carrots | 2 to 3 |
| Collards | 8 to 18 |
| Corn | 12 |
| Cucumbers | 12 to 18 |
| Lettuce, leaf | 4 to 8 |
| Lettuce, head | 12 |
| Mustard | 2 |
| Okra | 12 to 18 |
| Onions | 3 to 4 |
| Parsley | 4 to 6 |
| Peas, English | 2 |
| Peas, field | 4 to 6 |
| Pepper | 24 |
| Potato, Irish | 12 |
| Potato, sweet | 12 |
| Radish | 2 |
| Spinach | 4 |
| Squash | 36 |
| Tendergreens | 2 |
| Tomatoes | 18 to 36 |
| Watermelon | 4 feet to 6 feet |
Fall Gardening
Garden plots that were too wet for the spring garden may be just right for a fall garden. The fall garden should be located on soil that is loose, holds some moisture, and contains some organic matter or plant food.| Fall Planting List | |
| Beans, bush snap | Mustard |
| Beans, bush lima | Onion sets |
| Beans, pole snap | Parsley |
| Beans, pole lima | Potato, Irish |
| Broccoli | Radish |
| Carrots | Rutabaga |
| Chard, Swiss | Spinach |
| Chinese cabbage | Tendergreens |
| Kale | Tomatoes |
| Lettuce, leaf | Turnips |
| Lettuce, head | Rape |
Planting the Fall Garden
Moisture is most important in fall gardening. To get a quick stand of plants during a droughty period, practice these points:- Cultivate the row thoroughly and open deep- seed drill, 4 to 5 inches deep.
- Fill drill with water.
- Sow seeds twice as thick as for spring planting.
- Cover seeds with dry soil and do not water again until plants are up, unless you can use some covering, such as straw, on top of the row to prevent baking of the soil.
- Use hoe or rake to press soil over seeds.
Useful Garden Tables
| Fertilizer | 2 Cupfuls Weigh Approximately |
| Superphosphate | 1 pound |
| Muriate of potash | 1 pound |
| Limestone | 1 1/4 pounds |
| Mixed fertilizer (e.g.,13-13-13) | 1 pound |
| Cottonseed meal | 3/4 pound |
| Nitrate of soda | 1 3/4 pounds |
| Ammonium nitrate | 3/4 pound |
| Sulfate of ammonia | 3/4 pound |
| One bushel of moist manure (loose) weighs about | 30 pounds |
| One bushel of leaves or straw (packed) weighs about | 12-15 pounds |
| Example: If you want to weigh out 5 pounds of 13-13-13 fertilizer, by looking in the label you will find 1 pint (2 cupfuls) weighs approximately 1 pound, so you would measure out 10 level cupfuls. For 5 pounds of nitrate of soda, you would measure out 8 cupfuls. |
The Average Life In Years For Vegetable Seeds
Note: Some seeds are known to survive much longer.
| Vegetable | Years | Vegetable | Years | Vegetable | Years |
| Asparagus | 3 | Collards | 3 | Radish | 4 |
| Bush Lima beans | 3 | Eggplant | 4 | Spinach | 3 |
| Pole Lima beans | 3 | Lettuce | 6 | Squash (Summer) | 4 |
| Snap Beans | 3 | Mustard | 3 | Squash (Winter) | 4 |
| Beets | 4 | Okra | 1 | Sweet Corn | 3 |
| Broccoli | 5 | Parsley | 1 | Swiss Chard | 4 |
| Cabbage | 4 | Onions | 1 | Tomato | 3 |
| Carrots | 3 | Peas | 3 | Turnip | 4 |
| Cauliflower | 4 | Peppers | 2 | Watermelon | 5 |
| Cucumber | 5 | Pumpkin | 4 | New Zealand Spinach | 3 |
| Fresh Vegetables Needed To Can One Quart | Amount |
| Beans, lima in pod | 4 -5 lb |
| Beans, snap | 1 1/2 lb |
| Beets, without tops | 2 1/2-3 lb |
| Carrots, without tops | 2 1/2-3 lb |
| Corn, sweet, in husks | 6-16 ears |
| Okra | 1 1/2 lb |
| Peas, green, in pod | 2-2 1/2 lb |
| Spinach or greens | 2-3 lb |
| Squash, summer | 2-2 1/2 lb |
| Example: It would take 1 1/2 to 2 pounds of green snap beans to can one quart. |