c# - C#如何将两个日期与sqlite进行比较
问题描述
我尝试将 Sqlite 中的两个日期与我的 c# 代码进行比较,并且每次比较都返回相同的值。我不知道为什么。
我有两个具有相同值的表,但一个具有下载值,另一个具有本地值。我想同步这两个表。为此,我使用日期值“derniere_modification”,如果必须保存值,则将临时表 temp_mres 更新为 true,如果必须保存在线值,则将其更新为 false。
我的两个代码是:
>//On vérifie les données à mettre à jour dans la table de la tablette
>string sql = "UPDATE temp_mres SET synchronisation = 'true' WHERE julianDay >= (SELECT julianday(derniere_modification) FROM mres WHERE id = temp_mres.id)";
>SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
>command.ExecuteNonQuery();
>//On vérifie les données à mettre à jour en ligne
>string sql2 = "UPDATE temp_mres SET synchronisation = 'false' WHERE julianDay <= (SELECT julianday(derniere_modification) FROM mres WHERE id = temp_mres.id)";
>SQLiteCommand command2 = new SQLiteCommand(sql2, m_dbConnection);
>command2.ExecuteNonQuery();
当我查看我的 temp_mres 表时,我在同步中始终写为真,从不为假。
我的 sqlite 命令看起来对吗?你对我的问题有想法吗?
谢谢。
解决方案
推荐阅读
- jenkins - 在 Job 之间共享功能
- azure-devops - 将任务移至下一个 sprint 但燃尽图为空
- python - sklearn LinearModel、Ridge 和 Lasso 产生不兼容的输出?
- ansible - 如何使用剧本将远程目录复制到本地主机,目录包含不同的用户文件/文件夹?
- apache-pig - 为什么不能从 UNION 操作生成
- java - 如何从现有图像视图上的可绘制对象中获取图像名称
- linux - Android 平台工具:“正在为 UserX 的会话 2 运行停止作业”,我必须等待 90 秒才能关机
- python - Django 使用通用视图,“POST /''/ HTTP/1.1”405 0,不允许方法(POST)
- xml - 删除满足条件的节点,如果为空则删除父节点
- json - Groovy 从变量创建 Json