DataviewWHERE过滤条件

WHERE 过滤条件

Text 类条件

包含指定文本
#icontains 大小写不敏感
#contains 大小写敏感 
```dataview TABLE file.link as "文件名称" FROM "Study" WHERE icontains(file.name,"obsidian") ``` 
不包含指定文本
```dataview TABLE file.link as "文件名称" FROM "Study" WHERE !icontains(file.name,"obsidian") ``` 
以特定文本开头/结尾
```dataview TABLE file.link as "文件名称" FROM "Study" WHERE startswith(file.name,"Obsidian") or endswith(file.name,"dian") ```
英文大小写转换
```dataview TABLE file.link as "文件名称" FROM "Study" WHERE startswith(upper(file.name),"OBSIDIAN") or endswith(lower(file.name),"dian") ```

Number 类条件

#大于等于 >=
#不等于!=
…… WHERE number >= 8

Date 类条件

日期的格式化
```dataview TABLE dateformat(file.cday,"yyyy-MM-dd") as "创建日期", dateformat(file.ctime,"HH:mm: ss") as "创建时间",  FROM "Study" ``` 
大于等于指定日期
```dataview TABLE dateformat(file.cday,"yyyy-MM-dd") as "创建日期" FROM "Study" WHERE file.cday >= date("2023-02-19") ```
常用的日期属性
// year // month // day // date (today) // date (now) // date (tomorrow) // date (yesterday) // date (sow) // date (eow) 
#本月创建的
```dataview TABLE dateformat(file.cday,"yyyy-MM-dd") as "创建日期" FROM "Study" WHERE file.cday.month = date(today).month ``` 
 
 
```dataview TABLE dateformat(file.cday,"yyyy-MM-dd") as "创建日期" FROM "Study" WHERE file.cday >= date(sow) and file.cday <= date(eow) ```

Boolean 类条件

```dataview TABLE file.link as "文件名称", choice(file.starred, "是", "否") as "加星" FROM "study"  ``` 
```
…… WHERE contains(file.outlinks, [[内部文件链接]]) ```