© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•16mo ago
mrdudebro1

invalid column SQL

select  inv_mast.item_id, sum(qty_on_hand) qty_on_hand, max(invoice_date) latest_invoice_date from inv_mast
join inv_loc on inv_loc.inv_mast_uid = inv_mast.inv_mast_uid
full join p21_sales_history_report_view on inv_mast.inv_mast_uid = p21_sales_history_report_view.inv_mast_uid
where qty_on_hand > 0  and location_id <> 40 and latest_invoice_date <= DATEADD(YEAR,-2,getdate())
group by inv_mast.item_id
select  inv_mast.item_id, sum(qty_on_hand) qty_on_hand, max(invoice_date) latest_invoice_date from inv_mast
join inv_loc on inv_loc.inv_mast_uid = inv_mast.inv_mast_uid
full join p21_sales_history_report_view on inv_mast.inv_mast_uid = p21_sales_history_report_view.inv_mast_uid
where qty_on_hand > 0  and location_id <> 40 and latest_invoice_date <= DATEADD(YEAR,-2,getdate())
group by inv_mast.item_id


why is
latest_invoice_date
latest_invoice_date
considered an invalid column here

sql error
Invalid column name 'latest_invoice_date'.
Invalid column name 'latest_invoice_date'.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ [Sql Server] invalid column names
C#CC# / help
3y ago
❔ Invalid column name 'CityId'.
C#CC# / help
4y ago
SQL code invalid object name
C#CC# / help
17mo ago
Microsoft.Data.SqlClient.SqlException (0x80131904) Invalid object name 'Stand.Identity.Role'.
C#CC# / help
4y ago