Wednesday, July 6, 2016

Append Query error - tried to assign null value to a variable that is not a variant data type [Anwsered]

Append Query error - tried to assign null value to a variable that is not a variant data type

I am trying to archive some older data in my Fleet Maintenance data base.  I want to archive the data on all Sold Assets OR anything that is greater than my parameter given number of months AND less than $1000.   I've written the Archive query below, changed
it to an Append query.  Written the Delete Query, changed it to a Delete Query.  Wrote the Macro to run it.
When I run the Macro I get the error "You tried to assign the Null value to a variable that is not a Variant data type.
I am assuming that it is the Where (((Assets.[Sold Date]) Is Not Null))  that is causing the error.  In the table it has Date/Time as the Data Type and the Text Align is General.  
I've searched until my eyeballs are bleeding and I think I need to possibly convert it to a Variant in the query but I'll be blessed if I can figure out how.
I'm using Access 2007, know just enough SQL to be dangerous and enough VBA to copy lines of code well.  Help??
Archive Query:
PARAMETERS MonthsAgo Short;
INSERT INTO Maintenance_archive ( [PO Number], [Number], [Purchase Order Date], [Asset Description], Category, Description, Mileage, Vendor, [Estimated Cost], Disputed, [Invoice Number], [Vice President Approval], [Void Purchase Order Date], [System Date] )
SELECT Maintenance.[PO Number], Maintenance.Number, Maintenance.[Purchase Order Date], Maintenance.[Asset Description], Maintenance.Category, Maintenance.Description, Maintenance.Mileage, Maintenance.Vendor, Maintenance.[Estimated Cost], Maintenance.Disputed,
Maintenance.[Invoice Number], Maintenance.[Vice President Approval], Maintenance.[Void Purchase Order Date], Maintenance.[System Date]
FROM Assets LEFT JOIN Maintenance ON Assets.Number = Maintenance.Number
WHERE (((Assets.[Sold Date]) Is Not Null)) OR (((Maintenance.[Invoice Amount])<1000) AND ((Maintenance.[Invoice Date])
Delete Query: 
PARAMETERS MonthsAgo Short;
DELETE Assets.[Sold Date], Maintenance.[PO Number], Maintenance.Number, Maintenance.[Purchase Order Date], Maintenance.[Asset Description], Maintenance.Category, Maintenance.Description, Maintenance.Mileage, Maintenance.Vendor, Maintenance.[Estimated Cost],
Maintenance.[Invoice Amount], Maintenance.Disputed, Maintenance.[Invoice Number], Maintenance.[Invoice Date], Maintenance.[Vice President Approval], Maintenance.[Void Purchase Order Date], Maintenance.[System Date]
FROM Assets LEFT JOIN Maintenance ON Assets.Number = Maintenance.Number
WHERE (((Assets.[Sold Date]) Is Not Null)) OR (((Maintenance.[Invoice Amount])<1000) AND ((Maintenance.[Invoice Date])Macro:
OpenQuery, Archive Query, Datasheet, Edit
OpenQuery, Delete Query, Datasheet, Edit

Solutions to the Problem Append Query error - tried to assign null value to a variable that is not a variant data type

Download Error Fixer (Free)

In this expression:
  DateAdd("m",-[MonthsAgo],DateSerial(Year(Date()),Month(Date()),1))));
I would expect [MonthsAgo] to be an integer.
You are using a LEFT JOIN (I think) in your query.
Is there a particular reason for this since it might be pulling null values into a required field.

Running System Update Readiness Command

On running the System Update readiness Command, it will Detect & Replace Incorrect Registry data with the Correct one. Which may ultimately Solve Append Query error - tried to assign null value to a variable that is not a variant data type in Windows.

  1. Open CMD as Administrator by Simply Right Clicking on Start button > Command Prompt (Admin).
  2. Now Type or Copy paste "DISM.exe /Online /Cleanup-image /Scanhealth" and hit Enter,
  3. Now again Type or Copy paste this "DISM.exe /Online /Cleanup-image /Restorehealth" and hit Enter.
  4. Close the Command Prompt Window because we are done.

Try and see if you still get the same error Append Query error - tried to assign null value to a variable that is not a variant data type in your Windows.

Note: You may be prompted to enter your administrator's password when you try to execute certain system tasks!

Recommended Method to Repair the Problem: Append Query error - tried to assign null value to a variable that is not a variant data type:

How to Fix Append Query error - tried to assign null value to a variable that is not a variant data type with SmartPCFixer?

1. Click the button to download Error Fixer . Install it on your system.  Open it, and it will perform a scan for your computer. The junk files will be shown in the scan result.

2. After the scan is done, you can see the errors and problems which need to be fixed.

3. The Repair part is finished, the speed of your computer will be much higher than before and the errors have been fixed. You can also use other functions in this software. Like dll downloading, junk file cleaning and print spooler error repair.


Related: error message fsui.exe/ wlidcli.dll is missing
,Solution to Error: Excel: Automatic number generation
,Troubleshoot:i wanna change language of all windows in Windows 7 Home Premium
,Troubleshooting:IF Function, if the vendor ID in column A matches any of the vendor ID's in column F, I want 1099 to appear in column D. Error
,Fast Solution to Problem: ReadyBoost is not working properly in my computer
,Troubleshoot:Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive. Error,External Hard Drive not listed in Windows 7 backup wizard Tech Support,Tech Support: I'm always being signed off so annoying,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.,Referencing data in Access using Excel [Anwsered],Need Best Way To Present Data [Anwsered],Same question but for windows 7 home edition,sometimes fullscreen won't activate [Solved],Solution to Error: We bought a new computer with windows 7 and it is constantly freezing. How do we fix this?,Solution to Error: Windows 8 update crash (2013-07-22),brclr.dll.mu_ Missing Error Fixer,How To Resolve Missing fin_myagtui.eng Problem,Corrupted f_0006ad File - How to Fix,nkebigvg.cpl Not Found Error Fixer,Corrupted olcontrols.ocx File - How to Fix
Read More: Fast Solution to Problem: Any fix for WinSxS folder size in the offing?,How to Fix - AppData folder shows to have 170gigs in it. My hard drive is full. Can I delete the folder??,How to Resolve - Another end tag error - help!?,How to Resolve - Apparently my email on outlook express has been blocked by everyone. Can this happen??,Fast Solution to Problem: An error was raised trying to call the interop layer function '18' error detail 429,After Windows Update CD/DVD drive does not work,After installing windows 7 to laptop the labels print out of line how can I fix it,After my computer sleeps the wireless always disconnects and will no reconnect,After signing into Pogo.com, I get a message" This tab has been recovered"....what does this mean and how do I fix it.....,All desktop icons changed to windows live and does not open

No comments:

Post a Comment