Skip to Content
avatar image
Former Member

Need a query to select the records in the table.

Hi,

This is one record in my database.

<u><b>Field Name - Value</b></u>

Docid - 026464295

Logging_Indexing - 6/1/2006 12:00:00 AM

LogQ1 - 6/2/2006 12:00:00 AM

LogQ1Res - 6/3/2006 4:35:00 AM

LogQ2 - <b>Null</b>

LogQ2Res - <b>Null</b>

Logging_Indexing_End - 6/5/2006 4:35:00 PM

Here I dont have Log2 and LogQ2Res bcoz i have not raised 2nd query and completed the Logging_Indexing stage.

If I have all fields, i will write my query like this.

My Query is :

SELECT *

FROM dsr

WHERE #6/3/2006 4:35:00 AM# between Logging_Indexing and LogQ1 or #6/3/2006 4:35:00 AM# between LogQ1Res and LogQ2 or #6/3/2006 4:35:00 AM# between LogQ2Res and Logging_Indexing_End;

If I run this, i have get that record. but it is not giving any results.

If I dont have some values, like

if LogQ2 & LogQ2Res is NULL, then it has to check between LogQ1Res and Logging_Indexing_End.

If LogQ1 & LogQ1Res is also NULL, then it has to check between Logging_Indexing and Logging_Indexing_End.

I will be having mixture of all the types of recods in the database.

Logging_Indexing & Logging_Indexing_End are compulsory fields.

Please help me out in writing the query on these conditions.

Thanks in advance,

Venkat.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Aug 18, 2007 at 01:07 PM

    I got the solution

    Add comment
    10|10000 characters needed characters exceeded