How can I add a parameter to fetch customer names from a database in Crystal Reports 2013?
Is it possible to write a query in a formula to retrieve the data?
I have already used dynamic parameters, but they don't allow for searching. I also need to attach this report to SAP. Here is a sample of how the report is currently fetching data.
I tried dynamic parameters and it's fetching values but it's not query-based. I also want to fetch results when there is nothing selected so it should give all result.
Here is what I am getting:

Here is what I am expecting:

I'm not sure I understand what you are asking but my guess is that you need to use an Optional Parameter in combination with the HasValue() function. If you Google these terms you'll fins explanations and examples.
If that was not the issue, please try to clarify the question. Perhaps use the simplest possible clear example.