Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6143589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:32:33+00:00 2026-05-23T18:32:33+00:00

SELECT ‘Registered End Users’ AS ‘Report Name’, ‘Above Date Range’ AS ‘Desc’, CONVERT(VARCHAR, COUNT(*))

  • 0
SELECT 
   'Registered End Users' AS 'Report Name',
   'Above Date Range' AS 'Desc',
   CONVERT(VARCHAR, COUNT(*)) AS VALUE
FROM 
    WAPI_CUSTOMERS C
WHERE 
    C.ID NOT IN (SELECT S.CUSTOMER_ID FROM WAPI_SUBSCRIPTIONS S) 
    AND 
       CASE C.BASIC_REG_DATE IS NULL THEN C.FULL_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE
          WHEN C.FULL_REG_DATE IS NULL THEN C.BASIC_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE 
       END

Actually I have two table named wapi_customers and wapi_subscribers. I have have get all rows of customer table which are not in subscriber table between user selected date range.

In customer table I have two types of customers like basic and full.

  1. basic customers have isbasic=1 and basicregdate=somedate and isfull=0 and fullregdate=null
  2. full customers have isbasic=0 and basicregdate=null and isfull=1 and fullregdate=somedate
  3. case which are upgraded from basic to full:
    isbasic=1 and basregdate=somedate and fullregdate=1 and fulldate=somedate

Now I have to count customers which follow the above conditions means in case of basic
we will use C.BASIC_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE and in case of full
C.FULL_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE and in case of upgrade C.FULL_REG_DATE or C.BASIC_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE

Plz help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:32:34+00:00Added an answer on May 23, 2026 at 6:32 pm

    If I understood you correctly, following is something would work for you:

    where
     ( 
                (isbasic = 1 and basicregdate is not null and isfull=0  ) 
                and C.BASIC_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE 
          )
    or 
     ( 
                ( isbasic=0 and fullregdate=null and isfull=1 and fullregdate is not null) 
                and C.FULL_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE 
          )
    or
    (
           (isbasic=1 and basregdate is not null and fullregdate=1)
           and C.BASIC_REG_DATE BETWEEN @FROM_DATE AND @TO_DATE
    ) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SELECT DATE(DTM) AS'Dia', ROUND(COUNT(TMP)/4) AS 'Oídio' CASE ROUND(COUNT(TMP)/4)>=6 THEN '20' ROUND(COUNT(TMP)/4)<6 THEN '-10' END
SELECT CAST(CONVERT(varchar, W.CreateTS, 101)AS SMALLDATETIME) AS [SoldDate] ,COUNT(*) AS NumberOfWidgets ,FT.FormName FROM tblWidget W
SELECT `name` , COUNT(*) AS `count` FROM `t1`, `t2` WHERE `t2`.`id` = `t1`.`id` GROUP
select picks.`fbid`, picks.`time`, categories.`name` as cname, options.`name` as oname, users.`name` from picks left join
SELECT DISTINCT MonthName(Month([Date])) AS [Month], tblSupportCalls.System, Count(tblSupportCalls.System) AS [Total for System], Year([Date]) AS [Year]
select 'Owner' as 'Type', count(s.shipwynum) as Total, o.ownwynum as WYNum, o.ownshortnam as 'Short name',
SELECT game_ratingstblx245v.game_id,avg( game_ratingstblx245v.rating ) as avg_rating, count(DISTINCT game_ratingstblx245v.userid) as count, game_data.name, game_data.id , avg(game_ratings.critic_rating),count(DISTINCT
select count(category) from list where category like 'action' above is a query i want
SELECT users.id, COUNT(?) FROM orders INNER JOIN users ON (orders.user_id = users.id) WHERE ??
select * from sampleTable where CONVERT(VARCHAR(20),DateCreated,101) = CONVERT(VARCHAR(20),CAST('Feb 15 2012 7:00:00:000PM' AS DATETIME),101) I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.