SAP Business One Query: Customers Added Within a Certain Number of Days
Query will prompt the user for a number of days and show the customers that were added within that number of days. Copy and paste into the Query Generator and run.
/*This query will return all customers that have been added to the system */
/*within the number of days selected by the user. Leaving the number of */
/*days blank will return all customers*/
/*Sorted by Days Added Ago Acending */
/*Parameter Definitions*/
/*SELECT FROM [dbo].[ODUN] T0*/
declare @Days as int
/* WHERE */
set @Days = /* T0.EffctAftr */ ‘[%0]‘
/*Main Query Definition*/
SELECT T0.CardCode as ‘Customer#’, T0.CardName, T0.CreateDate
,datediff (day,T0.CreateDate,GetDate()) as ‘Days Ago’
FROM OCRD T0
WHERE T0.CardType=’C’ and (@days = 0) or (GetDate() – @Days) <= T0.CreateDate
ORDER BY ‘Days Ago’
FOR BROWSE
Thanks to Ed Monk of SBONotes.com
This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.
« SAP Business One Enhanced User Prompts in Queries | Home | SAP Business One Assigning a Formatted Search Query to a Field »
July 30, 2010
by: Wayne Schulz • Epicor, Publishers, Schulz Consulting
July 24, 2010
by: Wayne Schulz • 90minds
July 21, 2010
by: Wayne Schulz • FAQ, Sage MAS 200, Sage MAS 90, Schulz Consulting
July 20, 2010
by: Wayne Schulz • 90minds, Alnoor Cassim
July 19, 2010
by: Brett Zimmerman • Consultant, ERP, ERP Tools, FAQ, General Technology, MAS 200 Extended Enteprise Suite, Sage, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, Uncategorized, add ons
July 9, 2010
by: Beth Bowers • Beth Bowers, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, add ons, sage business insights intelligence
July 21, 2010
by: Wayne Schulz • FAQ, Sage MAS 200, Sage MAS 90, Schulz Consulting
July 19, 2010
by: Brett Zimmerman • Consultant, ERP, ERP Tools, FAQ, General Technology, MAS 200 Extended Enteprise Suite, Sage, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, Uncategorized, add ons
July 9, 2010
by: Beth Bowers • Beth Bowers, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, add ons, sage business insights intelligence
July 1, 2010
by: Wayne Schulz • 90minds, News, Sage, Sage MAS 90
June 24, 2010
by: Brett Zimmerman • Consultant, FAQ, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, Schulz Consulting, Uncategorized
June 14, 2010
by: Mark Chinsky • Clients First Business Solutions, Sage MAS 200, Sage MAS 90, Uncategorized
July 21, 2010
by: Wayne Schulz • FAQ, Sage MAS 200, Sage MAS 90, Schulz Consulting
July 19, 2010
by: Brett Zimmerman • Consultant, ERP, ERP Tools, FAQ, General Technology, MAS 200 Extended Enteprise Suite, Sage, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, Uncategorized, add ons
July 9, 2010
by: Beth Bowers • Beth Bowers, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, add ons, sage business insights intelligence
June 24, 2010
by: Brett Zimmerman • Consultant, FAQ, Sage MAS 200, Sage MAS 90, Sage MAS 90 Extended Enterprise Suite, Schulz Consulting, Uncategorized
June 14, 2010
by: Mark Chinsky • Clients First Business Solutions, Sage MAS 200, Sage MAS 90, Uncategorized
June 4, 2010
by: Mark Chinsky • Clients First Business Solutions, Sage MAS 200, Sage MAS 90, Uncategorized, jobops
Leave a Comment
You must be logged in to post a comment.