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!

Extract records with no value 1

Status
Not open for further replies.

Shaves

Technical User
Feb 11, 2008
17
US
Good Morning.........I'm writing a sql (ACCESS) statement to insert records into a table. There are 2 criteria: (1) Group and (2) Cost Center. The problenm I having is I'm not sure how to write the sql statement to extract the records where the cost center does not have a value.

xSQL = "INSERT INTO HeaderFile ([FTPFileDate], [Group], [Region], [Loc], [AcctNo] IN MyDB SELECT DLFile.Date, DLFile.Group, DLFile.Region, DLFile.Loc, DLFile.AcctNo FROM DLFile WHERE DLFile.Group = """ & ProcGrp & """ And DLFile.Region = ????"

Thanks for the help.
 
How about

Code:
xSQL = "INSERT INTO HeaderFile ([FTPFileDate], [Group], Region, Loc, AcctNo IN MyDB " & _
       "SELECT [Date], [Group], Region, Loc, AcctNo " & _
       "FROM DLFile " & _
       "WHERE [Group] ='" & ProcGrp & "' AND " & _
             "[cost center] Is Null AND " & _
             "Region = ????"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top